Is there anyway to freeze or lock the DOM of a page, so no further changes (CSS or Javascript etc) can be made to it?
I keep having difficulty in finding elements that appear or disappear when the div
or page loses focus.
My normal approach of right clicking an element to inspect it makes the element disappear from the DOM.
By manually searching through the DOM Inspector, I can find the element, but as soon as I click on it inside the Inspector the element disappears from the DOM.
This whole situation results in certain interactive parts of the page being complete unreachable. I cannot find out what CSS rules are applied to them, what line number in which CSS file I should look or anything. And I really dont want to have to search through multiple CSS files, looking at each rule and trying to figure out if this is the rule I am looking for.
In Chrome, if you know the containing element in the interface that will be modified then right click on it and "Inspect Element" (or go straight to it in the DOM if that's easier for you), then right click on the element in the DOM and choose "Break On..." > "Subtree modifications" (or whichever other option would ...
Freezing: In order to “freeze” the browser, we will need to first open devTools, and then use F8 (fn + F8 on osx) to pause script execution whenever you want. The debugger will pause, and you'll be able to inspect the elements on the screen in their current state, Simple as that!
Open devTools (F12) Select the “Sources” tab. While the element you want is displayed, press F8 (or Ctrl+/). This will break script execution and “freeze” the DOM exactly as it is displayed.
Have you tried using one of the options in Break on...
in the context menu for DOM elements in the Chrome Developer Console?
For example, Break on Node removal
. This will act as a breakpoint for removal of a particular DOM element.
(click the image to see it larger)
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