Table of Contents
DOM tree node search
Screenshot
Chrome Tips: Check the Top Level
Home Web Front-end CSS Tutorial Some Cross-Browser DevTools Features You Might Not Know

Some Cross-Browser DevTools Features You Might Not Know

Mar 09, 2025 pm 12:10 PM

Some Cross-Browser DevTools Features You Might Not Know

Developer tools are a daily weapon for front-end developers. This article will share some less-known practical features in cross-browser developer tools to help you debug more efficiently.

For simplicity, "Chromium" will be used in the article to refer to all Chromium-based browsers such as Chrome, Edge, and Opera. Their developer tools are highly consistent in functionality.

Facing the nested DOM nodes at layers, finding the target node can be time-consuming and laborious. Use Cmd F (macOS) or Ctrl F (Windows) to quickly search for the DOM tree.

Supports CSS selectors (e.g. <code>.red) and XPath expressions (e.g. <code>//div/h1) searches.

In Chromium browser, searches will automatically jump to the matching node, which can be troublesome when handling long queries or large DOM trees. You can turn off this feature by going to Settings (F1) → Preferences Global Enter while searching Disable

.

After finding the node, right-click on the node and select "Scroll to View" to scroll it to the viewing area.

Accessing node from console

Developer Tools provide multiple ways to access DOM nodes directly from the console:

<code><code>For example, <code> can access the currently selected DOM node. The Chromium browser goes a step further and allows access to nodes in the history selection using <code>,

,

, etc. Right-click on the node and select Copy → <code>document.querySelectorCopy JS path

, and you can copy the node path as a JavaScript expression (

form), which is convenient for access in the console.

    Another way is to store the node as a temporary variable. Right-click on the node and select the corresponding option:
  • Chromium
  • : Right-click → "Save as global variable"
  • Firefox
  • : Right-click → “Use in the console”
  • Safari
: Right-click → “Record Element”

Visualize elements with tags

Developer tools can help visualize elements with specific attributes by displaying tags next to nodes. Tags are clickable, and the types of tags provided by different browsers are also different. In <code>display: gridSafari<code>display: inline-grid, there is a marker button in the Elements Panel toolbar to toggle the visibility of a specific marker. For example, if a node has a

or

CSS declaration applied, a grid mark is displayed next to it. Clicking on the mark will highlight the grid area, track size, line number, etc. on the page.

FirefoxTags currently supported by the developer tool are listed in the Firefox source documentation. For example, a scroll mark indicates a scrollable element. Clicking on a mark highlights the element that causes the overflow and displays the overflow mark next to it.

In the Chromium browser, you can right-click on any node and select "Tag Settings..." to open a container with all available tags. For example, an element with <code>scroll-snap-type will have a scroll snap tag next to it, and clicking on that tag will toggle the scroll snap overlay on that element.

Screenshot

All mainstream browsers now support screenshots from developer tools and provide a new method of full page screenshots.

Right-click on the DOM node you want to capture and select the option to capture the node (different browser tags are different).

Repeat this operation on the html node to take a full page screenshot. It should be noted that Safari retains the transparency of the background color of the element, while Chromium and Firefox capture it as a white background.

You can also take "responsive" screenshots to capture the page with a specific viewport width. The operation methods of different browsers are as follows:

  • Chromium: Cmd Shift M (macOS) or Ctrl Shift M (Windows). Or click the Device icon next to the Check icon.
  • Firefox: Tools → Browser Tools → “Responsive Design Patterns”
  • Safari: Development → “Enter Responsive Design Mode”

Chrome Tips: Check the Top Level

Chrome allows you to visualize and inspect top-level elements such as dialog boxes, alerts, or modal boxes. When an element is added to <code>#top-layer, a top-level mark is displayed next to it. Clicking on the mark will jump to the top-level container that is located after the <code>

The above is the detailed content of Some Cross-Browser DevTools Features You Might Not Know. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Vue 3 Vue 3 Apr 02, 2025 pm 06:32 PM

It&#039;s out! Congrats to the Vue team for getting it done, I know it was a massive effort and a long time coming. All new docs, as well.

Building an Ethereum app using Redwood.js and Fauna Building an Ethereum app using Redwood.js and Fauna Mar 28, 2025 am 09:18 AM

With the recent climb of Bitcoin’s price over 20k $USD, and to it recently breaking 30k, I thought it’s worth taking a deep dive back into creating Ethereum

Can you get valid CSS property values from the browser? Can you get valid CSS property values from the browser? Apr 02, 2025 pm 06:17 PM

I had someone write in with this very legit question. Lea just blogged about how you can get valid CSS properties themselves from the browser. That&#039;s like this.

Stacked Cards with Sticky Positioning and a Dash of Sass Stacked Cards with Sticky Positioning and a Dash of Sass Apr 03, 2025 am 10:30 AM

The other day, I spotted this particularly lovely bit from Corey Ginnivan’s website where a collection of cards stack on top of one another as you scroll.

A bit on ci/cd A bit on ci/cd Apr 02, 2025 pm 06:21 PM

I&#039;d say "website" fits better than "mobile app" but I like this framing from Max Lynch:

Comparing Browsers for Responsive Design Comparing Browsers for Responsive Design Apr 02, 2025 pm 06:25 PM

There are a number of these desktop apps where the goal is showing your site at different dimensions all at the same time. So you can, for example, be writing

Using Markdown and Localization in the WordPress Block Editor Using Markdown and Localization in the WordPress Block Editor Apr 02, 2025 am 04:27 AM

If we need to show documentation to the user directly in the WordPress editor, what is the best way to do it?

Why are the purple slashed areas in the Flex layout mistakenly considered 'overflow space'? Why are the purple slashed areas in the Flex layout mistakenly considered 'overflow space'? Apr 05, 2025 pm 05:51 PM

Questions about purple slash areas in Flex layouts When using Flex layouts, you may encounter some confusing phenomena, such as in the developer tools (d...

See all articles