Skip to content

Instantly share code, notes, and snippets.

@prashantpalikhe
Created July 23, 2018 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prashantpalikhe/1e9ef71637c346384aa21e00dc9f951f to your computer and use it in GitHub Desktop.
Save prashantpalikhe/1e9ef71637c346384aa21e00dc9f951f to your computer and use it in GitHub Desktop.
Using $$ in Chrome devtools console to detect broken links
Promise
.all(
$$('a')
.map(link => link.href)
.map(href => fetch(href))
)
.then(() => console.log('All links working'))
.catch(() => console.error('Some links are broken'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment