Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Chrome Dev Tools 基礎技巧
Search
chph
November 03, 2017
Technology
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Chrome Dev Tools 基礎技巧
afu @ PIXNET | Tech Free Talk 踢克大小事 #4 | 2017.11.03
chph
November 03, 2017
More Decks by chph
See All by chph
DevOpsDays Taipei 2017 敏捷思維分享
chph
0
120
在 Google Cloud Platform 架設你的網站伺服器並撰寫 Node.js 應用程式
chph
0
720
Intro to Progressive Web Apps
chph
1
78
淺談 Gzip
chph
0
140
Install WordPress on Linode
chph
0
170
Introduction Infrastructure - Linode 入門
chph
0
240
高速傳愛~三小時進化 PWA
chph
0
310
Optimize JavaScript execution and parse time using optimize-js
chph
0
170
Modern Web 2016 議程分享: 網站自動化測試 - 以 PIXNET 搜尋 & 美妝口碑大賞為例
chph
0
140
Other Decks in Technology
See All in Technology
2026-09-04 SRE Tech Talk #15 怠惰なTerraform / Lazy Terraform
masasuzu
0
230
AI-DLCって実際どう? 〜聞きたいこと全部聞いてみる〜
news_it_enj
0
250
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
25k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
3
450
2026/09/10 Spring Bootから Jakarta EE/MicroProfileへの移行
megascus
0
300
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
290
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
120
クロスボーダーM&AのValue Upを支えるプロダクト開発。日米チームのハブになったプロダクトエンジニアの実践 / Product Engineering Conference 2026
genda
0
110
プロダクト思考 × 基盤思考を AIで実現する Compound Engineering
tkc66buzz
1
310
日経電子版を支えていく Kasane Design System/fec_fukuoka
nikkei_engineer_recruiting
0
620
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
3
300
Tab5をRubyで動くパソコンにする
kishima
2
280
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How to make the Groovebox
asonas
2
2.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
480
How GitHub (no longer) Works
holman
316
150k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Thoughts on Productivity
jonyablonski
76
5.4k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
202
76k
WENDY [Excerpt]
tessaabrams
13
39k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Transcript
Chrome Dev Tools 基礎技巧 研發中心前端組 Afu
• Chrome 版本簡介 • Elements • Console • Sources •
Network • 「More tools」 • 最新功能搶先看 Agenda
v62 2017/10/17 釋出 穩定版 (stable channel) 適合一般使用者
v64.0.3255 幾乎每天更新 不穩定的開發版本 適合開發人員和嘗鮮者
https://download-chromium.appspot.com/ v64.0.3256+ 主幹版本 (master),CI 建置 沒有自動更新機制 適合開源專案貢獻者
Elements 元素
DOM Manipulation 選取元素的幾種方法: 一、在目標處滑鼠右鍵選擇「檢 查」 二、使用開發者面板第一個 inspect 按鈕,再點選目標元素 三、按 cmd
+ f 開啟搜尋文字框,輸入 CSS Selector 匹配想要的元素,例如「 #header」
選取元素時,可以: • 新增編輯刪除屬性或直接編輯 HTML • 可以用鍵盤操作,例如方向鍵走訪元素、 delete 鍵刪除元素、Ctrl-C & V
複製貼上新元素 • 複製對應的 CSS Selector (右鍵選單) • 強制套用虛擬類別,例如 :hover,讓元素套用CSS 樣式,讓滑鼠位置不被綁死,方便除錯 • 移動頁面捲軸到直接把元素顯示在視線 內垂直正中央 (右鍵選單 - Scroll into view) DOM Manipulation (左側面板)
選取元素時,可以: • 新增編輯刪除 CSS 樣式 • 了解樣式優先權順序,最上面的 element.style 最優先 (inline
style) • 知道該 Selector 的 CSS 檔案載入來源 • 了解樣式繼承關係 • 了解在 Box Model 下,邊界 (margin)、邊框 (border) 、留白 (padding) 佔據多少像素 DOM Manipulation (右側面板 Styles)
選取元素時,可以: • 了解在 Box Model 下,邊界 (margin)、邊框 (border) 、留白 (padding)
佔據多少像素 • 列出所有 CSS Property 屬性被設定的值 • 點箭頭可跳躍至定義該 CSS 樣式的行數 DOM Manipulation (右側面板 Computed)
選取元素時,可以: • 知道被綁定哪些事件,例如 click、keydown、keyup 等等 • 迅速定位至該事件是在哪個 js 檔案哪一行綁定的 •
移除綁定的事件使其無效以便除錯 • 例如綁了多個 click 事件,刪去法找出哪個造成 bug • 練習: • 在 http://cssreference.io/ 找出 JS 實作的搜尋程式碼位置 DOM Manipulation (右側面板 Event Listeners)
DOM Manipulation (右側面板 Event Listeners)
DOM Manipulation (右側面板 DOM Breakpoints) 藍色圓點
DOM Manipulation (右側面板 DOM Breakpoints) 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
Console
• $_ 最近一次的運算結果 • $0 - $4 最近五次選取的元素 • $(selector)
等同 document.querySelector() • $$(selector) 等同 document.querySelectorAll() • console 系列的 alias function • dir(), dirxml(), table() Console
Console 藍色圓點
Sources 原始碼
Sources - format code 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
Sources - format code 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
Sources - format code 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
Network 原始碼
Network 面板 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
在任一欄位按右鍵可以自訂要看哪些欄位 Network 面板
篩選 URL 包含關鍵字的 requests Network 面板 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
按住 command 可複選多種類型的 Requests 點選漏斗圖案可以取消篩選 Network 面板 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger
mode
勾選 Preserve log 可以保留 request,方便多次重新整理網頁除錯 Network 面板 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger
mode
按下 ESC 的面板 藏在「 」裡的
切換到 Animations 頁籤,重新整理網頁可以錄製 CSS 動畫 ESC 面板 / Animations 觸發元素屬性變更的程式碼敘述
暫停程式執行,進入 debugger mode
封鎖指定的網域 reqeusts,以痞客邦相片網域 pimg.tw 為例 ESC 面板 / Request blocking
切換到 Coverage 頁籤,按下錄製鈕即可見,額外作其他操作會即時更新圖表 ESC 面板 / Coverage (CSS / JS
覆蓋率)
模擬地理位置 (geolocation) ESC 面板 / Sensors
Console - Filter sidebar 更有條理地過濾 console 訊息 | Chrome 64+
限定
Console - Filter sidebar 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
Local Overrides 本地覆寫 | Chrome 64+ 限定
Sources / Overrides 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
None
Sources / Overrides 觸發元素屬性變更的程式碼敘述 暫停程式執行,進入 debugger mode
1. Chrome DevTools | Google Web Developers 2. Dev Tips
- Developer Tips by Umar Hansa 3. Code School - Discover DevTools 4. Modern Tooling, Testing, and Automation (Chrome Dev Summit 2017) 參考資料
None