1

I have an element that pops up when a mouse is moved over it. The element comes up as a result of a mouseover event, not through the use of css hover.

I am trying to inspect this hovered element in Firefox and I can right-click and select Inspect and I can see that dev tools jump to that element. However, the moment I move my mouse away from the hovered element, it disappears.

So, how do I inspect a hover element in Firefox?

P.S. As I mentioned, the element comes up as a result of a mouseover event, not css :hover, therefore I can't use the toggling of pseudo-classes in the dev tools.

P.P.S There is a similar question for Chrome, but none of those answers work with Firefox.

AngryHacker
  • 59,598
  • 102
  • 325
  • 594
  • 1
    [What about this, from your linked question?](https://stackoverflow.com/a/35188471/2569323) Perhaps with a `setInterval()`. – deEr. Apr 24 '18 at 05:11
  • Why don't you (temporarily) write a `mouseout` event for same element, with same code, so it will make sure that element won't be disappeared. Once your inspection is done, remove `mouseout` event. – Kiran Shinde Apr 24 '18 at 05:22
  • @JuvenileSnow Why bother commenting about Chrome? OP _clearly_ stated Firefox. – jhpratt Apr 24 '18 at 05:33
  • @JuvenileSnow OP themselves already provide a solution for Chrome, in the question...or you missed that part? – Asons Apr 24 '18 at 05:38
  • 1
    As Firefox clearly have some issues with this,[https://bugzilla.mozilla.org/show_bug.cgi?id=962491](https://bugzilla.mozilla.org/show_bug.cgi?id=962491) (if you follow its referenced links you get more info), could you provide a code sample showing the issue you describe, where the element disappears, or your main question is about being able to do this in FF? – Asons Apr 24 '18 at 05:44
  • @AjAX. That's genius! While `$('#foo').trigger('mouseover');` didn't do the trick, `$('#foo').trigger('click');` did for some reason. The hovered element comes up, but the key is to have the mouse cursor over the dev tools because if you move it over the webpage, `mouseout` fires and the hovered element goes away. Instead in the Inspector tab, I just searched for the words on the hovered element and was able to get to it. It's a horrible hack but at least it works! Make it an answer and I'll accept it. – AngryHacker Apr 24 '18 at 06:55
  • @AjAX. Another way to do is to `$('#foo').trigger('click');`, then go into the Debugger tab and pause execution - that freezes everything, so you can't inspect it, but you can search HTML for your hovered element. – AngryHacker Apr 24 '18 at 06:58
  • Since the suggested link lead to the answer, I closed this as a dupe to the same. – Asons Apr 24 '18 at 07:02
  • Too late for answering. But you found the way to do a `click`. Which is by the way — not — answered in the dupli. @LGSon – deEr. Apr 24 '18 at 07:05
  • @AjAX. ...so add one there :) – Asons Apr 24 '18 at 07:06
  • 1
    @LGSon It is not a dupe at all. The workaround is completely different. That was for Chrome, this is for Firefox. The answer AjAX pointed out simply led me to the path - it wasn't the path itself. – AngryHacker Apr 24 '18 at 07:12
  • When hover with mouse, Use shortcut ctrl+shift+c and click on element. – DivineCoder Apr 24 '18 at 07:13
  • This question ... Don't people read questions anymore ..? They're just answering some bulls... – Teemu Apr 24 '18 at 07:41

0 Answers0