Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to freeze or lock the DOM of a page?

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.

like image 831
Jimmery Avatar asked Aug 25 '16 12:08

Jimmery


People also ask

How do you freeze a DOM structure?

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 ...

How do I freeze DOM in Chrome?

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!

How do I freeze DOM in selenium?

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.


1 Answers

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.

enter image description here

(click the image to see it larger)

like image 155
sdgluck Avatar answered Oct 22 '22 23:10

sdgluck