Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inspecting drop down menus in new Chrome

I'm on Chrome Version 41.0.2272.101 m (newest), and this update is messed up. They put it, when you have inspector open, that any DOM change will flash with purple on the changed element (like in Firefox), but now I cannot inspect any hovered object (also like in FF, which is why I don't like to use it when doing front end developing).

I'm talking about js triggered events, like superfish for instance. Before, I could hover the menu, and cover the menu with the inspector, and the menu would stay opened, and I could go in the inspector see what pseudoelements are created, change the paddings and such directly, and see the change. Now, when I hover the menu, and right click to inspect it, the menu closes, and I cannot inspect it!

I tried dragging the inspector over, but nothing helped. This new 'feature' is annoying as hell. Is there a way to inspect js triggered events, without putting break points on elements (which works, but is kinda pain in the ass)?

like image 330
dingo_d Avatar asked Apr 01 '15 08:04

dingo_d


People also ask

Why won't drop down menus work in Chrome?

Try this "setting in google chrome and at the very bottom, show advanced setting, scroll through the list until you see "use hardware acceleration when available". Un-check this box! " Yeah I was able to fix the problem and now it works!

How do I inspect pop up elements in Chrome?

right click the page and select inspect. Then trigger the popup so that it is displayed. Now search the dom in the inspect window for some unique text in the popup. that should get you to the elements of the popup in the dom.

How do you inspect select options?

To access inspect mode while the dropdown box is open. Open the Dev Tools, click the dropdown and then use the shortcut to get to inspect mode ( Ctrl + Shift + C for chrome).


3 Answers

Hover over the element with your mouse and press F8 (this will only work in Chrome) to pause the script execution. The hover state will remain in visible to you. If you're on a Mac, you may have to open system preferences and check off "Use all F1,F2,etc" check box (Or simply use fn + F8).

Sometimes it only works if you are in the Sources tab of the inspector.

*Yes, you should be in the source tab and MOST IMPORTANT is you should close all the opened tabs in the Sources tab before you press F8(win) or Fn+F8(mac). *

like image 114
icekomo Avatar answered Oct 18 '22 18:10

icekomo


Depending on the menu element type, I ran into this issue with drop-down input menus. The reason it's disappearing when I inspect it, is because a blur or focusout event is always triggered on the element when I click anywhere outside the element.

One way I was able to inspect the element is to prevent these events from being triggered is by removing their event listeners:

  • Inspect the input element on Chrome
  • Go to the Event Listeners tab and remove the blur or focusout event enter image description here

Once the event listeners are removed, you can open the menu and inspect it without disappearing

like image 154
mmohammad Avatar answered Oct 18 '22 19:10

mmohammad


In Chrome, press F12 to open the developer console, then click on Settings (cogwheel icon) or press F1:

Dev tools Settings

then find & check the "Emulate a focused page" option.

Check Emulate a Focused Page Option

Update: as noted in comments, this option is now in another place. See this answer.

like image 74
Said Madi Avatar answered Oct 18 '22 20:10

Said Madi