Tips for Chrome 35 Developer Tools, chrome developers
Source: w3cplus-North and South (@ ping4god)
Web: http://www.w3cplus.com/tools/dev-tips.html
Google Chrome is now the most popular Web browser for Web developers. With the release cycle every six weeks and the ever-expanding powerful development features, Chrome has become a necessary tool. Most of them may be familiar with many features of chorme, such as usingconsole
Anddebugger
Edit CSS online. In this article, we will share some cool tips to help you better improve your workflow.
Passconsole
Modify page elements and content on the panel:
- Retrieve element nodes
- Right-click
Edit as HTML
OrEdit Text
- The modified content is reflected on the page and
Elements
Panel
inspect()
/copy()
/values()
AndCtrl + L
- In
console
Panel usageinspect(elem)
Jumpelements
The specified Element Node of the Panel.
- In
console
Panel usagecopy(values)
Copy Data to clipboard
- In
console
Panel usagevalues(object)
Obtains all attribute values of an object and returns an array.
- Use
Ctrl + L
Clear the currentconsole
Panel
JS file opening and quick jump in the file
- In
Sources
Panel usageCMD + O
Shortcut key to open the search box
- The search box displays the JS files on the current page. Enter the file name to open the file.
- If you enter
:5:9
To jump to the ninth character of the object
InSources
Panel usageAlt + -
AndAlt + =
You can jump between the previous and next mouse positions
InElements
Panel usageCMD + F
Open the search box. In addition to regular strings, you can use the selector to select HTML elements.
Right-click the preview image and choosecopy image as Data URI
To convert the image to base64 encoding.
UseCMD + Click
You can create multiple editing points in the file.CMD + U
You can cancel the last edit point.
Press and holdAlt
Key and select the file content to create a rectangular selection area
InNetwork
Filter input box of the PanelIs:running
Command to view network requests in progress
InElements
Right side of the PanelEvent Listeners
Tab, right-click the Bound event to jump to the corresponding JS Code
Sometimes we need to open the link in anonymous mode. Now Chrome can maintain the same developer tool status when you open the link anonymously, such as the same toolbar location, size, panel layout, and setting information.
InConsole
Use in panelgetEventListeners(node)
The function can obtain the events bound to the current node and return an array.
InElements
On the Panel, right-click the inline JS or CSS path and selectopen
You canSources
Open the corresponding file in the panel
Numeric adjustment shortcut
Up / Down
, Increase or decrease by 1 unit
Shift + Up / Down
, Increase or decrease by 10 units
Alt + Up / Down
To increase or decrease the number of units by 0.1.
- Scroll wheel
UseCMD + [ or ]
You can switch the various panels of the developer tool cyclically.
Sets a condition breakpoint for JS Code. This breakpoint is triggered only when the condition is met.
Select a piece of code in the JS fileCtrl + Shift + E
You canConsole
Run this code in the panel
After separating the developer tool from the browser, useCMD + Alt + i
Another developer tool will be created, which can be used to modify the style of the first developer Tool
Useconsole.trace()
Tracing stack information during Code Execution
InTimeline
Some frames are highlighted in red in the panel, because these frames are worth the attention of developers and their rendering time is usually over 18 ms. Click these red frames to view the corresponding warning information. Generally, the rendering of 60 frames per second is smooth, which requires that the rendering of each frame cannot exceed 16 ms.
The Canary developer tool provides a hidden layout editor.
InSources
Use in panelCMD + Opt + F / Ctrl + Shift + F
You can search for information about all objects.
UseTab
Keys can be traversed and selected in CSS style rules. The selected targets include selector, attribute, and attribute value. If you want to jump back to the previous target, useShift + Tab
UseUp / Down
The shortcut key can modify the value in the DOM element attribute.
Adjust DOM element styles
InConsole
The Panel provides a series of filters for filtering specific information, suchHandled
Filters can be used to capture the reject status of Promises.
Useconsole.time('sign string')
Andconsole.timeEnd('sign string')
Obtain the intermediate Interval
Useconsole.table(arr)
Output array data
In the Canary version, if you hover your mouse over a selector for a long time, the Elements panel on the left will highlight the matched DOM element area.
Manually blocks URL loading to test the page Effect of failed resource retrieval.
In the Canary version, a Constly Functions module is added to the Timeline panel to record performance in four aspects: Painting/Rendering/Scripting/Network activity.
Rearranging the Panel sequence on the developer tool by dragging
Elements
The Panel follows the mouse to hover the target to display different DOM elements
You can use the animation Checker to check the running CSS animation attributes.
Visualized resource dependency: Green Resources are initialized resources, and red resources are introduced by green resources.
References
- How to Use Chrome developer tools more professionally
- 15 tips for Chorme dev tools you have to know
- Google devtools
- Dev tips