Created
February 23, 2020 20:52
-
-
Save jpgninja/2c74c6cdf22bd48ed372bd229c8eb0f3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* | |
* Bookmarklet which highlights nofollow links for 3 seconds. | |
* | |
* Usage as a bookmarklet: | |
* javascript:(()=>{let e=()=>{document.body.querySelectorAll('a[rel="nofollow"]').forEach(e=>e.style.border="none")};(()=>{document.body.querySelectorAll('a[rel="nofollow"]').forEach(e=>e.style.border="1px solid red")})(),setTimeout(e,3e3)})(); | |
*/ | |
(()=>{ | |
let run = () => { | |
highlight(); | |
setTimeout(unhighlight, 3000); | |
} | |
let highlight = () => { | |
document.body.querySelectorAll('a[rel="nofollow"]').forEach((el) => el.style.border = '1px solid red'); | |
} | |
let unhighlight = () => { | |
document.body.querySelectorAll('a[rel="nofollow"]').forEach((el) => el.style.border = 'none'); | |
} | |
run(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment