DevToolsSnippets
A collection of front-end debugging script snippets to be used in the Sources panel in Chrome DevTools.
You can copy these scripts and add them to your collection of snippets.
This not a replacement for automatic testing tools like the HTML validator, Lighthouse, axe, or Wave. This collection of scripts is meant to be used in addition to automatic testing tools.
Scripts
Document Info
- Logs the page
<title>
- Logs the page description
- Logs the defined natural language
- Logs the charset
- Logs the number of DOM nodes in
<head>
- Logs the number of DOM nodes in
<body>
- Lists headings and document outline
Debug images
- Lists images without
width
and/orheight
attributes - Lists images with empty
alt
attributes - Lists images with suspicious
alt
attributes
Remove CSS
For testing HTML output without CSS.
- Removes all
<link>
s to CSS files - Removes all
style
elements - Removes all
style
attributes
Is x present?
- Checks if elements that usually should be present, are actually there.
- Checks if elements that probabaly shouldn’t be present, aren’t there.