How can I inspect disappearing element in a browser?

前端 未结 10 1843
灰色年华
灰色年华 2020-12-04 05:43

How can I inspect an element which disappears when my mouse moves away? \"Example

10条回答
  •  情书的邮戳
    2020-12-04 06:27

    (This answer only applies to Chrome Developer Tools. See update below.)

    Find an element that contains the disappearing element. Right click on the element and apply "Break on... > Subtree Modifications." This will throw a debugger pause before the element disappears, which will allow you to interact with the element in a paused state.

    Update Oct 22 2019: with the release of v. 70, it looks like FireFox finally supports this kind of debugging 2 3:

    Update Sep 15 2020: Chrome has an "Emulate a focused page" option (you can get it from the [⌘]+[P] Command Menu, or Global Preferences) for this exact need. 5 - h/t @sulco on Twitter

提交回复
热议问题