Skip to content

Instantly share code, notes, and snippets.

@hendrixjoseph
Last active January 20, 2021 20:35
Show Gist options
  • Save hendrixjoseph/44606404cac66e2d163dfdb9f0fc89d7 to your computer and use it in GitHub Desktop.
Save hendrixjoseph/44606404cac66e2d163dfdb9f0fc89d7 to your computer and use it in GitHub Desktop.
Tampermonkey / Greasemonkey Userscript To Easily Identify DoFollow and NoFollow Links
// ==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;}');
})();
@hendrixjoseph
Copy link
Author

hendrixjoseph commented Apr 3, 2019

I talk about creating this gist on my blog post entitled Easily Check if a Link is DoFollow or NoFollow with CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment