Inspecting drop down menus in new Chrome

Google Chrome

Google Chrome Problem Overview


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)?

Google Chrome Solutions


Solution 1 - Google Chrome

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

Solution 2 - Google Chrome

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

Solution 3 - Google Chrome

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.

Solution 4 - Google Chrome

On Mac, you can press cmd+</kbd> to pause the script after having opened the dropdown. You can then use shift+cmd+c to inspect elements.

Solution 5 - Google Chrome

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

In Chrome 86 and above you can find "Emulate a focused page" option here:

DevTools >> Elements >> "Kebab" menu (3 vertical dots by the settings cog) >> More tools >> Rendering.

Alternately: With Devtools open: Hit CTRL/CMD+SHIFT P to open the command menu HUD, enter "emulate a fo" to narrow the search results and enter (or click) to toggle the setting.

Solution 6 - Google Chrome

> Now, when I hover the menu, and right click to inspect it, the menu > closes, and I cannot inspect it!

I faced the same issue and what I used was Expand recursively option on chrome dev tools:

The steps are:

  1. Inspect the dropdown field
  2. Find the dynamic DOM (the purple highlight)
  3. Right-mouse click on that dynamic DOM
  4. Choose Expand recursively: enter image description here
  5. We can see all elements are there

Here is a demo:

enter image description here

Solution 7 - Google Chrome

In Firefox

In Inspector, right click on a node that contains the dropdown, select:

Break on... > Subtree modification

This will pause execution the moment dropdown is... well... dropped down.

Solution 8 - Google Chrome

I just used emulate a focused page and it worked like a charm

  1. go to settings
  2. go to more tools
  3. find Rendering
  4. find "emulate a focused page" and click the radio button

voala now you can inspect your select element

Solution 9 - Google Chrome

You can set an interval that writes out the content of a given element in the JS console every second. Drop this in the console and open the dropdown.

setInterval(() => 
    console.log(document.querySelector('.Select-menu-outer').outerHTML),
1000)

Solution 10 - Google Chrome

Only way that would work for me was doing setTimeout(() => { debugger }, 3000) in the console and opening the dropdown while timeout was running.

Pressing pause button in dev tools UI or F8 key to pause script execution would both close the menu.

Solution 11 - Google Chrome

I think you can use the CSS Editor in Chrome to apply a state, for instance, the state of 'hover'.

In the Developer Tools, you select an element. On the right hand you have a square with an arrow over it. Click that and you can choose a state. For instance, pick hovered and you'll see both your window and your CSS update as if the element is being hovered right now.

Solution 12 - Google Chrome

None of the above referred remedies worked for me. As our drop down (React based) will close on any single click (right or left) So we found out the below workaround:

  • In Chrome Open developer tools

  • first click on the drop-down in collapsed state & let it expand with options

  • then under the element section, right-click on the div node (make sure not to left click before right clicking), which contains details of the drop-down items

  • Then select option 'Expand Recursively'

  • Then required details were shown enter image description here

Solution 13 - Google Chrome

On Windows, press F12 first, at the page with the menu, then point your mouse to the element menu (the menu will drop down), then press CTRL + Shift + C. Now you can inspect all the elements.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questiondingo_dView Question on Stackoverflow
Solution 1 - Google ChromeicekomoView Answer on Stackoverflow
Solution 2 - Google ChromemmohammadView Answer on Stackoverflow
Solution 3 - Google ChromeSaid MadiView Answer on Stackoverflow
Solution 4 - Google ChromelowerendsView Answer on Stackoverflow
Solution 5 - Google ChromeBenView Answer on Stackoverflow
Solution 6 - Google ChromeRaja DavidView Answer on Stackoverflow
Solution 7 - Google ChromeDmitry ShvedovView Answer on Stackoverflow
Solution 8 - Google ChromeBojidariView Answer on Stackoverflow
Solution 9 - Google ChromeAdam LibušaView Answer on Stackoverflow
Solution 10 - Google ChromeraineView Answer on Stackoverflow
Solution 11 - Google ChromeSteven LemmensView Answer on Stackoverflow
Solution 12 - Google Chromeuser2451016View Answer on Stackoverflow
Solution 13 - Google ChromeMarco FlorianoView Answer on Stackoverflow