Taking a look at https://developer.chrome.com/devtools/docs/tips-and-tricks#favorite-expression
If I don\'t set any breakpoints, then I have to manually click on the
Check out Live Expressions. These are similar to Watch Expressions, expect they're in the Console and they update in real-time.
wOxxOm's hack for displaying the average FPS of a Performance recording gave me inspiration on how we could hack together a solution to this problem:
In the second DevTools window, run this code in the Console:
let id;
UI.panels.sources._watchSidebarPane.widget().then(ui => {
id = setInterval(() => {
ui._refreshButton.element.click();
}, 1000);
});
We essentially just set a timer to click the "Refresh Watch Expressions" button every second.
Here's an example of the hack in action: https://youtu.be/w-3rqFhziQ4
The reason you have to open the Sources panel before running the code is because the UI.panels
object only contains panels that you've opened. If you don't open Sources, the reference to UI.panels.sources
will be undefined.