Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore clicks in the Chrome Dev Tools pane

I'm trying to look at and alter the style of some elements that display on click and hide when anywhere else on the page is clicked (it's a modal popup). The problem is that clicking on the developer tools pane triggers the "click anywhere else" action, so the elements I'm trying to look at are being hidden.

How can I ignore clicks in the Chrome developer tools pane so the click action doesn't fire?

(Tagging jQuery and Javascript because I'm not sure if it's a problem with Chrome or if I need to load the script a different way.)

like image 496
vaindil Avatar asked Feb 09 '16 19:02

vaindil


People also ask

How do you stop an infinite loop in Chrome DevTools?

click Chrome DevTools window to get focus on it, pause script with F8, Ctrl+\ or by clicking Pause script execution button, press mouse button for 1-3 seconds on the button again to see more options, move click action to square stop button on expanded menu to stop permanently script execution.


2 Answers

Ah, there is a nice trick for this.

Go to the Sources panel, and pause the script execution using "fn + F8" keyboard shortcut. (Hover over pause icon to see what the keyboard shortcut is for your OS)

Now use the element selector from top left corner of the dev tool to select the element of your choice and inspect its styles.

like image 96
Prashant Avatar answered Sep 24 '22 08:09

Prashant


Most of the time the freezing code execution using shortcut works. But just ran into a case where it didn't for some reason (maybe it's a CSS only hide/show 🤷🏽‍♂️).

Managed to get it working by finding the container the popover was being rendered into in the Elements Panel → Right-clicking on it → Selecting "Break on/subtree modifications

This should pause code execution on show/hide - giving you time to inspect.

enter image description here

Hope this helps. Cheers 🥳

like image 20
Jose Browne Avatar answered Sep 24 '22 08:09

Jose Browne