Created
July 23, 2018 19:31
-
-
Save prashantpalikhe/1e9ef71637c346384aa21e00dc9f951f to your computer and use it in GitHub Desktop.
Using $$ in Chrome devtools console to detect broken links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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