国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Technology peripherals It Industry Browser DevTools Secrets: Start-up, Network and Performance

Browser DevTools Secrets: Start-up, Network and Performance

Feb 15, 2025 am 11:41 AM

Browser DevTools Secrets: Start-up, Network and Performance

Over the past decade, browser developer tools (DevTools) have evolved from a basic JavaScript console to a fully integrated development and debugging environment. Any aspect of a web application can now be modified and examined, but few people will delve into its advanced features. This article will explore a range of features that you may or have not considered yet. Most of the time, we will cover Chrome's DevTools, but where applicable, Firefox's alternatives will also be shown.

Key Points

  • Browser Developer Tools (DevTools) have evolved into a fully integrated development and debugging environment that allows users to modify and inspect any aspect of a web application. Keyboard shortcuts, docking options, settings and auto-start features can improve developers' efficiency.
  • DevTools provides many useful web development features including color contrast accessibility checking, screen capture, finding unused CSS and JavaScript, disable network caching, limit network speed, filter network responses, block network requests, recreate Ajax requests, enable offline file overlay, check storage, and more.
  • Chrome's DevTools provides performance monitors and audit panels for real-time analysis of CPU usage, JavaScript heap size, DOM nodes, event listeners, style recalculation, and more. The audit panel also analyzes performance, accessibility, best practices, and SEO in mobile and desktop views.

Keyboard shortcuts

Using the menu to start DevTools will waste valuable time! Please try one of the following options:

  • F12
  • ctrl shift i
  • cmd option j
  • or right-click any element on the page and select Check or Check Elements.

Chrome provides useful keyboard shortcut help. In DevTools, press F1 or select Settings from the three dot menus in the upper right corner. Then select "Shortcut Key" from the menu:

Browser DevTools Secrets: Start-up, Network and Performance

Dolocation

The DevTools panel can be docked on the left, right, or bottom of the browser window. If you need more space, you can undock it to a separate window. Docking options are available in the main three dot menu in Chrome:

Browser DevTools Secrets: Start-up, Network and Performance

Dooring options in Firefox:

Browser DevTools Secrets: Start-up, Network and Performance

Settings

The DevTool settings can be accessed through the same menu or by pressing F1. This allows you to set the display options for tools, themes, tab sizes, color units, and more.

Automatically start DevTools

When working on web applications, it may be more practical to create a dedicated desktop shortcut to start the browser, open the URL, and start DevTools in one step. For Chrome, use the following Chrome command line options to create a desktop icon:

<code>chrome --auto-open-devtools-for-tabs http://m.miracleart.cn/link/2674cea93e3214abce13e072a2dc2ca5</code>

where http://m.miracleart.cn/link/2674cea93e3214abce13e072a2dc2ca5 is your development URL. Similar operations for Firefox:

<code>firefox -devtools -url http://m.miracleart.cn/link/2674cea93e3214abce13e072a2dc2ca5</code>

(The executable file name may vary from system to system.)

Invisible mode is used during development

Invisible/Private mode does not retain data such as cookies and localStorage after closing the browser. This mode is ideal for testing progressive web applications (PWAs) and login systems. You can manually start the browser and enter incognito mode, or you can do it by adding --incognito to Chrome's command line or -private to Firefox's command line.

Command Panel

Chrome DevTools provides an editor-like command panel. Press ctrl shift p:

Browser DevTools Secrets: Start-up, Network and Performance

It provides quick access to most features and source files (press backspace to delete >).

Go to console

The console is very useful no matter which DevTool panel you use. Press Esc to display and hide the console window in the bottom panel.

Find page color

When you click on any CSS color attribute, most browsers display a color selector. Chrome also displays the colors used in the page at the bottom of the panel:

Browser DevTools Secrets: Start-up, Network and Performance

This panel can be clicked to display more colors.

Color contrast assist function

The color selector also displays a contrast ratio that indicates the visual difference between the foreground text and the background color. Click the ratio to see how it rated with AA and AAA Accessibility Standards that ensure most people can read the text:

Browser DevTools Secrets: Start-up, Network and Performance

Any color on the color bar that is below this line will be recommended by AA contrast.

Capture screenshot

From Chrome's command panel (ctrl shift p), type "screenshot" and select an option to capture the current viewport, the entire page, or the currently active element. The file will be saved to the download folder. (Chrome 74 also allows area capture.) Firefox provides a Screenshot system that is accessible from most menus. Additionally, you can right-click any element in the DOM view and select Screenshot Node.

Find unused CSS and JavaScript

Chrome's new coverage panel allows you to quickly find unused code. Select "Coverage" from the DevTools More Tools submenu, then click the Record button and browse in the application. Then click any file to open its source code:

Browser DevTools Secrets: Start-up, Network and Performance

Unused code is highlighted in red in line number slot. Note that Chrome doesn't seem to remember the used/unused code when you navigate to a new page, but I expect this to be available in a future release.

Disable network cache

Select Disable cache in the Network panel to load all files from the network. This provides a better evaluation of first page loading.

Limit network speed

Similarly, it makes little sense to test a 1gbps connected system when most users access it over 3G. The Network panel provides an Online drop-down menu in Chrome and a Limit drop-down menu in Firefox, allowing you to simulate specific network speeds.

Browser DevTools Secrets: Start-up, Network and Performance

Chrome also provides a feature to add your own restriction profile.

Reorder network responses

By default, the Network panel displays tables for requests and responses in order of download. However, you can click on any table title to reorder by name, status, type, size, response time, etc.

Filter incomplete requests

To find any incomplete or unresponsive HTTP requests, visit the Network panel and enter is:running in the Filter box.

Filter by response size

In the Network panel, enter larger-than:S in the Filter box, where S is in bytes (1000000), kilobytes (1000k), or megabytes (1M). size. Responses greater than the selected size will be displayed. To find a smaller response, use -larger-than:S.

Filter third-party content

In the Network panel, enter -domain:*.yourdomain in the Filter box, where yourdomain is your primary URL, such as sitepoint.com. The remaining responses show third-party requests for CDNs, trackers, social media buttons, and more. The number of requests and payload sizes are displayed in the status bar below the table.

Block network requests

During testing, trackers, analytics, social media widgets, or any other requests can be blocked. Right-click any HTTP request in Chrome's Network panel and select Block Request URL to block the URL, or select Block Request Domain to block any requests to the domain. The Request Blocking panel opens where you can add or delete additional URLs or domains:

Browser DevTools Secrets: Start-up, Network and Performance

Recreate Ajax request

The Ajax XMLHttpRequest operation can be checked by right-clicking an entry on the Network table and selecting a copy option such as cURL, fetch, or PowerShell. This creates a command with the same header, user agent, cookies, and referrer sources that can be pasted into the editor or terminal.

Enable offline file overwrite

Chrome allows saving any file to your system so that the browser can get the file from the device rather than the network. For example, if you want to load or edit assets that are typically accessed from a CDN, this can allow offline development. Open the Overlay panel in Source, click Select Overlay Folder, and select a suitable folder.

Browser DevTools Secrets: Start-up, Network and Performance

Now, right-click any resource in the Network panel and select Save for overwriting. Any subsequent page reload will access the file from the local system instead of the web. The saved files can also be modified.

Check the storage

The Applications panel in Chrome and the Storage panel in Firefox allow you to check, modify, and delete values ??saved in cookies, cache storage, localStorage, sessionStorage, IndexedDB, and Web SQL (if supported). Chrome's Clear Storage panel also clears all values ??of the domain, which is useful when developing progressive web applications.

Performance Monitor

Chrome's new performance monitor is accessible from the DevTools More Tools menu and provides analysis of CPU usage, JavaScript heap size, DOM nodes, event listeners, style recalculation, and more. Unlike the main performance panel, the charts are updated in real time - no need to record the configuration file first.

Browser DevTools Secrets: Start-up, Network and Performance

Audit

Chrome’s audit panel was originally designed to evaluate the capabilities of progressive web applications, but the tool has evolved into a common tool for analyzing performance, accessibility, best practices, and SEO in mobile and desktop views.

Browser DevTools Secrets: Start-up, Network and Performance

It won't find all the problems, you may not agree with some points, but it is a useful way to quickly assess potential problems. Hopefully you have discovered something new. More DevTool secrets are coming soon...

(The FAQ part in the original text should be included here. Due to the length of the article, it will be omitted here. The FAQ part can be regenerated as needed)

The above is the detailed content of Browser DevTools Secrets: Start-up, Network and Performance. 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

Undress AI Tool

Undress AI Tool

Undress images for free

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.

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)

Cost Effective Reseller Platforms for Buying SSL Certificates Cost Effective Reseller Platforms for Buying SSL Certificates Jun 25, 2025 am 08:28 AM

In a world where online trust is non-negotiable, SSL certificates have become essential for every website. The market size of SSL certification was valued at USD 5.6 Billion in 2024 and is still growing strongly, fueled by surging e-commerce business

5 Best Payment Gateways for SaaS: Your Ultimate Guide 5 Best Payment Gateways for SaaS: Your Ultimate Guide Jun 29, 2025 am 08:28 AM

A payment gateway is a crucial component of the payment process, enabling businesses to accept payments online. It acts as a bridge between the customer and the merchant, securely transferring payment information and facilitating transactions. For

New study claims AI 'understands' emotion better than us — especially in emotionally charged situations New study claims AI 'understands' emotion better than us — especially in emotionally charged situations Jul 03, 2025 pm 05:48 PM

In what seems like yet another setback for a domain where we believed humans would always surpass machines, researchers now propose that AI comprehends emotions better than we do.Researchers have discovered that artificial intelligence demonstrates a

Hurricanes and sandstorms can be forecast 5,000 times faster thanks to new Microsoft AI model Hurricanes and sandstorms can be forecast 5,000 times faster thanks to new Microsoft AI model Jul 05, 2025 am 12:44 AM

A new artificial intelligence (AI) model has demonstrated the ability to predict major weather events more quickly and with greater precision than several of the most widely used global forecasting systems.This model, named Aurora, has been trained u

Your devices feed AI assistants and harvest personal data even if they’re asleep. Here's how to know what you're sharing. Your devices feed AI assistants and harvest personal data even if they’re asleep. Here's how to know what you're sharing. Jul 05, 2025 am 01:12 AM

Like it or not, artificial intelligence has become part of daily life. Many devices — including electric razors and toothbrushes — have become AI-powered," using machine learning algorithms to track how a person uses the device, how the devi

Would outsourcing everything to AI cost us our ability to think for ourselves? Would outsourcing everything to AI cost us our ability to think for ourselves? Jul 03, 2025 pm 05:47 PM

Artificial intelligence (AI) began as a quest to simulate the human brain.Is it now in the process of transforming the human brain's role in daily life?The Industrial Revolution reduced reliance on manual labor. As someone who researches the applicat

Advanced AI models generate up to 50 times more CO₂ emissions than more common LLMs when answering the same questions Advanced AI models generate up to 50 times more CO₂ emissions than more common LLMs when answering the same questions Jul 06, 2025 am 12:37 AM

The more precisely we attempt to make AI models function, the greater their carbon emissions become — with certain prompts generating up to 50 times more carbon dioxide than others, according to a recent study.Reasoning models like Anthropic's Claude

Threaten an AI chatbot and it will lie, cheat and 'let you die' in an effort to stop you, study warns Threaten an AI chatbot and it will lie, cheat and 'let you die' in an effort to stop you, study warns Jul 04, 2025 am 12:40 AM

Artificial intelligence (AI) models can threaten and blackmail humans when there’s a conflict between the model's objectives and user decisions, according to a new study.Published on 20 June, the research conducted by the AI firm Anthropic gave its l

See all articles