Hover over a Live Expression to highlight a DOM node
當一個 Live Expression 的執行結果爲一個 DOM 節點時, 懸浮在 Live Expression 的結果之上來在視口中高亮該結果.
When a Live Expression evaluates to a DOM node, hover over the Live Expression result to highlight that node in the viewport.
存儲 DOM 節點爲全局變量
Store DOM nodes as global variables
爲了存儲一個 DOM 節點爲全局變量, 在 Console 中執行一個表達式, 其執行結果爲一個節點, 右擊執行結果, 而後選擇 Store as Global variable.
To store a DOM node as a global variable, run an expression in the Console that evaluates to a node, right-click the result, and then select Store as global variable.
或者, 在 DOM 樹中右擊該節點, 而後選擇 Store as global variable.
Or, right-click the node in the DOM Tree and select Store as global variable.
Initiator 和 priority 信息如今存在 HAR 導入和導出中
Initiator and priority information now in HAR imports and exports
若是你想要和同事分享診斷網絡的日誌, 你能夠將網絡請求導出到一個 HAR 文件
If you'd like to diagnose network logs with colleagues, you can export the network requests to a HAR file.
要導入這個文件回到網絡面板中, 只要拖拽和放下該文件(譯者注: 必須在網絡面板中)
To import the file back into the Network panel, just drag and drop it.
當你導出一個 HAR 文件的時候, DevTools 如今在 HAR 文件中包含 initiator 和 priority 信息. 當你導入一個 HAR 文件回到 DevTools的時候, initiator 和 Priority 列如今將被填充.
When you export a HAR file, DevTools now includes initiator and priority information in the HAR file. When you import HAR files back into DevTools, the Initiator and Priority columns are now populated.
The _priority field states what priority level the browser assigned to the resource. This maps to the Priority column in the Requests table, which is hidden by default.
右擊 Requests 表格的頭部, 而後選擇 Priority 來顯示 Priority 列.
Right-click the header of the Requests table and select Priority to show the Priority column.
注意: _initiator 和 _priority 字段如下劃線開頭是由於 HAR 規範 說明自定義的字段必須如下劃線開頭.
Note: The _initiator and _priority fields begin with underscores because the HAR spec states that custom fields must begin with underscores.
從主菜單進入命令菜單
Access the Command Menu from the Main Menu
使用命令菜單來快速進入 DevTools 面板, 標籤, 和特性.
Use the Command Menu for a fast way to access DevTools panels, tabs, and features.
你如今能夠從主菜單打開命令菜單. 點擊主菜單 按鈕, 而後選擇 Run command.
You can now open the Command Menu from the Main Menu. Click the Main Menu
button and select Run command.
Enable the enterpictureinpicture, leavepictureinpicture, and resize checkboxes in the Event Listener Breakpoints pane to pause whenever one of these picture-in-picture events fires. DevTools pauses on the first line of the handler.
(驚喜提示) 在 Console 中執行 monitorEvents() 來監聽一個元素的事件觸發
(Bonus Tip) Run monitorEvents() in the Console to watch an element's events fire
注意: 該段介紹一個較不爲人所知的特性, 可是其已經存在於 DevTools 中很長時間了.
Note: This section covers a lesser-known feature that has been in DevTools for a long time.
假設你想要在這個 button 被聚焦同時依次按下 R, E, D 的時候給它的周圍添加一個紅色的邊框, 可是你不知道要監聽什麼事件. 使用 monitorEvents() 來在 Console 中打印關於該元素的全部事件.
Suppose you want to add a red border around a button after focusing it and pressing
R,
E,
D, but you don't know what events to add listeners to. Use monitorEvents() to log all of the element's events to the Console.
獲取該節點的一個引用.
Get a reference to the node.
將該節點做爲第一個參數傳遞給 monitorEvents()
Pass the node as the first argument to monitorEvents().
和該節點作交互. DevTools 在 Console 中打印關於該節點的全部事件.
Interact with the node. DevTools logs all of the node's events to the Console.
調用 unmonitorEvents() 來中止在 Console 中打印事件.
Call unmonitorEvents() to stop logging events to the Console.
To discuss the new features and changes in this post, or anything else related to DevTools:
File bug reports at Chromium Bugs.
Discuss features and changes on the Mailing List. Please don't use the mailing list for support questions. Use Stack Overflow, instead.
Get help on how to use DevTools on Stack Overflow. Please don't file bugs on Stack Overflow. Use Chromium Bugs, instead.
Tweet us at @ChromeDevTools.
File bugs on this doc in the Web Fundamentals repository.
Consider Canary
Consider Canary
若是你使用 Mac 或者是 Windows, 考慮使用 Chrome Canary 做爲你的默認開發瀏覽器. Canary 可讓你體驗到最新的 DevTools 特性.(譯者注: 譯者已經將 Chrome Canary 做爲默認瀏覽器好久了, 爲 Web 稍做貢獻)
If you're on Mac or Windows, consider using Chrome Canary as your default development browser. Canary gives you access to the latest DevTools features.
Note: Canary is released as soon as its built, without testing. This means that Canary breaks about once-a-month. It's usually fixed within a day. You can go back to using Chrome Stable while Canary is broken.