Elements
Kiểm Tra & Chỉnh Sửa
Right-click -> InspectMở panel Elements cho phần tử
Double-click tag/attributeChỉnh sửa HTML trực tiếp
Delete keyXóa node đang chọn
Ctrl+ZHoàn tác thay đổi DOM
H keyẨn/hiện phần tử đang chọn
Drag nodeDi chuyển phần tử trong cây DOM
Panel Styles
element.style {}Thêm inline style cho phần tử
Click property valueChỉnh sửa giá trị CSS trực tiếp
Checkbox cạnh ruleBật/tắt thuộc tính CSS
:hov buttonÉp pseudo-state (:hover, :focus)
.cls buttonThêm/xóa CSS class
Color swatchMở color picker
Tab ComputedXem giá trị CSS tính toán cuối cùng
Console
Console API
console.log("info"); console.warn("warning"); console.error("error"); console.table(arrayOrObj); console.group("label"); console.groupEnd(); console.time("t"); /*...*/ console.timeEnd("t");
Tiện Ích Console
$0Phần tử đang chọn trong Elements
$('sel') / $$('sel')Rút gọn querySelector / querySelectorAll
copy(obj)Sao chép object thành chuỗi vào clipboard
clear()Xóa đầu ra console
monitor(fn)Log các lần gọi hàm fn
monitorEvents(el, 'click')Log sự kiện trên phần tử
keys(obj) / values(obj)Keys / values của object
$_ Kết quả của biểu thức vừa thực thi
Lọc
Log levels dropdownLọc theo verbose/info/warn/error
Filter text boxTìm kiếm trong đầu ra console
-url:extensionLoại trừ message theo URL nguồn
context: dropdownLọc theo ngữ cảnh iframe/worker
Network
Tính Năng Panel Network
Filter barLọc theo loại: XHR, JS, CSS, Img, Doc, WS
Search (Ctrl+F)Tìm kiếm trong tất cả body request/response
Preserve logGiữ log khi điều hướng trang
Disable cacheBỏ qua cache trình duyệt khi DevTools mở
Throttling dropdownGiả lập Slow 3G, Fast 3G, Offline
Block request URLChuột phải vào request -> Block URL
Tab Chi Tiết Request
HeadersHeader request/response, status code
PayloadBody POST, query parameters
PreviewResponse được định dạng (JSON, HTML, ảnh)
ResponseBody response thô
TimingDNS, connect, TLS, TTFB, download
InitiatorStack trace kích hoạt request
CookiesCookie được gửi/nhận
Sao Chép & Xuất
Right-click -> Copy as cURLSao chép request dưới dạng lệnh cURL
Copy as fetchSao chép dưới dạng fetch() JavaScript
Export HARXuất tất cả request dưới dạng file HAR
Copy responseSao chép body response vào clipboard
Sources
Breakpoints
Click số dòngBật/tắt breakpoint dòng
Right-click -> ConditionalDừng chỉ khi biểu thức đúng
Right-click -> LogpointLog mà không dừng thực thi
DOM breakpointDừng khi subtree/attribute/node bị thay đổi
XHR/Fetch breakpointDừng khi URL chứa chuỗi
Event listener breakpointDừng khi loại sự kiện cụ thể xảy ra
Điều Khiển Debugger
F8 / Ctrl+\Tiếp tục / Tạm dừng thực thi
F10Bước qua lời gọi hàm tiếp theo
F11Bước vào lời gọi hàm
Shift+F11Bước ra khỏi hàm hiện tại
Ctrl+Shift+P -> "never pause"Tắt tất cả breakpoint
Panel Debug
WatchTheo dõi giá trị biểu thức
ScopeBiến local, closure, global
Call StackChuỗi gọi hàm
SnippetsLưu và chạy đoạn code JS tái sử dụng
Performance
Ghi Lại
Record button (Ctrl+E)Bắt đầu/dừng ghi performance
Reload buttonGhi performance khi tải trang
Screenshots checkboxChụp ảnh timeline
CPU throttle dropdownGiả lập làm chậm CPU 4x/6x
Network throttleGiả lập mạng chậm khi ghi
Đọc Flame Chart
Main trackThực thi JavaScript (flame chart)
Network trackTimeline network request
Frames trackFPS và thời gian frame
Timings trackMarker FCP, LCP, DCL, Load
Thanh vàngJavaScript (scripting)
Thanh tímLayout / rendering
Thanh xanhPainting / compositing
Bottom-Up & Summary
Tab SummaryPhân tích thời gian: scripting, rendering, v.v.
Tab Bottom-UpCác hàm tốn thời gian nhất trước
Tab Call TreePhân cấp gọi hàm từ gốc đến lá
Tab Event LogDanh sách sự kiện theo thứ tự thời gian
Application
Lưu Trữ
Local StorageXem/sửa cặp key-value theo origin
Session StorageXem/sửa storage theo phiên
IndexedDBKiểm tra object store và record
CookiesXem/sửa/xóa cookie theo domain
Cache StorageKiểm tra cache của Service Worker
Clear storageXóa hàng loạt các loại storage đã chọn
Service Workers & Manifest
Service WorkersXem đăng ký, trạng thái, push/sync
Update on reloadÉp cập nhật SW khi reload
Bypass for networkBỏ qua SW, đi thẳng tới mạng
ManifestXem chi tiết web app manifest
Offline checkboxGiả lập chế độ offline
Lighthouse
Chạy Audit
Mode: NavigationAudit toàn bộ lần tải trang
Mode: TimespanAudit tương tác người dùng theo thời gian
Mode: SnapshotAudit trạng thái trang hiện tại
CategoriesPerformance, Accessibility, Best Practices, SEO
DeviceGiả lập Mobile hoặc Desktop
Các Chỉ Số Quan Trọng
FCP (First Contentful Paint)Thời gian đến nội dung hiển thị đầu tiên
LCP (Largest Contentful Paint)Thời gian đến phần tử lớn nhất hiển thị
TBT (Total Blocking Time)Tổng thời gian bị chặn bởi long task
CLS (Cumulative Layout Shift)Điểm độ ổn định bố cục
SI (Speed Index)Tốc độ hiển thị nội dung
INP (Interaction to Next Paint)Độ phản hồi với tương tác người dùng
Phím Tắt
Mở DevTools
F12 / Ctrl+Shift+IBật/tắt DevTools
Ctrl+Shift+JMở panel Console
Ctrl+Shift+CMở Elements + chế độ inspect
Ctrl+Shift+MBật/tắt thanh công cụ thiết bị (responsive)
Điều Hướng & Tìm Kiếm
Ctrl+Shift+PCommand Menu (chạy bất kỳ hành động nào)
Ctrl+PMở file (Go to File)
Ctrl+Shift+FTìm kiếm trên tất cả sources
Ctrl+GĐến số dòng trong Sources
Ctrl+[ / Ctrl+]Chuyển đổi giữa các panel
Chỉnh Sửa & Console
Ctrl+Shift+DChuyển đổi vị trí dock DevTools
Ctrl+L (Console)Xóa đầu ra console
Shift+Enter (Console)Nhập nhiều dòng
EscBật/tắt console drawer
Ctrl+K (Console)Xóa console
Debug Mobile
Device Toolbar
Ctrl+Shift+MBật/tắt thanh thiết bị
Device dropdownKích thước điện thoại/máy tính bảng có sẵn
Responsive modeTự do thay đổi kích thước viewport
DPR dropdownThay đổi tỷ lệ pixel thiết bị
ThrottlingGiả lập CPU + mạng di động
Show media queriesHiển thị CSS breakpoint
Remote Debugging (Android)
1. Bật USB debuggingSettings -> Developer Options trên thiết bị
2. Kết nối USBKết nối thiết bị Android với máy tính
3. chrome://inspectMở trong Chrome máy tính
4. Click InspectMở DevTools cho trang mobile

Cần Chrome trên cả máy tính và thiết bị Android

Ghi Đè Sensors
GeolocationGhi đè tọa độ GPS
OrientationGiả lập hướng thiết bị
TouchGiả lập sự kiện cảm ứng
Idle detectionGhi đè API phát hiện idle
Các Pattern Thường Gặp
Debug Sự Cố Mạng
// Trong Console: theo dõi tất cả fetch request const origFetch = window.fetch; window.fetch = (...args) => { console.log('fetch:', args); return origFetch(...args); };
Quy Trình Performance
1. Lighthouse auditXác định vấn đề performance hàng đầu
2. Performance recordingTìm long task trong flame chart
3. Tab CoverageTìm CSS/JS không dùng (Ctrl+Shift+P -> Coverage)
4. Network waterfallXác định tài nguyên blocking
5. Tab RenderingHiển thị paint/layout (Ctrl+Shift+P -> Rendering)
Đoạn Code Console Hữu Ích
// Liệt kê tất cả event listener trên phần tử getEventListeners($0); // Theo dõi layout shift new PerformanceObserver(l => l.getEntries().forEach( e => console.log('CLS:', e) )).observe({ type: 'layout-shift', buffered: true });