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 refresh icon in the watch expressions panel. It would be nice if I could put in some debugging code to update the watch expressions without ever having to enter debug mode.
Something like this:
// some update function
setInterval(function() {
console.refresh();
}, 1000);
Or, Hold down Ctrl and press F5. Just open the Chrome Dev Tools by pressing F12. Once the chrome dev tools are open, just right click on the refresh button and a menu will drop down. This menu gives you the option of doing a hard refresh, or even clearing the cache and do a hard refresh automatically.
Right-click on the screen and choose Inspect element. Click on Console tab. Reload the page.
F12, or Ctrl + Shift + I to open the Developer Tools. Ctrl + Shift + J to open the Developer Tools and bring focus to the Console. Ctrl + Shift + C to open the Developer Tools in Inspect Element mode, or toggle Inspect Element mode if the Developer Tools are already open.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With