Last active
January 20, 2021 20:35
-
-
Save hendrixjoseph/44606404cac66e2d163dfdb9f0fc89d7 to your computer and use it in GitHub Desktop.
Tampermonkey / Greasemonkey Userscript To Easily Identify DoFollow and NoFollow 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
// ==UserScript== | |
// @name NoFollow / DoFollow Hover-Highlighter | |
// @namespace https://hendrixjoseph.github.io/ | |
// @version 0.1 | |
// @description To Easily Identify DoFollow and NoFollow Links | |
// @author JoeHx | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var style = document.createElement("style"); | |
style.appendChild(document.createTextNode("")); | |
document.head.appendChild(style); | |
style.sheet.insertRule('a::before {display: none; position: absolute; font-size: small;}'); | |
style.sheet.insertRule('a::before {content: "(dofollow)"; color: black; background: yellow;}'); | |
style.sheet.insertRule('a[rel~="nofollow"]::before {content: "(nofollow)"; color: white; background: blue;}'); | |
style.sheet.insertRule('a:hover::before {display: inline;}'); | |
//style.sheet.insertRule('a {color: black; background: yellow;}'); | |
//style.sheet.insertRule('a[rel~="nofollow"] {color: white; background: blue;}'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I talk about creating this gist on my blog post entitled Easily Check if a Link is DoFollow or NoFollow with CSS.