Retro hyperlinks

Make hyperlinks more visible. Guaranteed to make most pages uglier.

  1. // ==UserScript==
  2. // @name Retro hyperlinks
  3. // @namespace Violentmonkey Scripts
  4. // @description Make hyperlinks more visible. Guaranteed to make most pages uglier.
  5. // @match http://*/*
  6. // @match https://*/*
  7. // @version 2.1
  8. // @author pnppl
  9. // ==/UserScript==
  10.  
  11. const COLOR_BLUE = '#00278E'; // dark theme: #77B6FF
  12. const COLOR_PURPLE = '#6C00A2'; // #CE6BFF
  13.  
  14. function addGlobalStyle(css) { // fair use from “Greasemonkey Hacks by Mark Pilgrim, Copyright © 2006 O’Reilly Media, Inc., 0-596-10165-1.”
  15. var head, style;
  16. head = document.getElementsByTagName('head')[0];
  17. if (!head) { return; }
  18. style = document.createElement('style');
  19. style.type = 'text/css';
  20. style.innerHTML = css;
  21. head.appendChild(style);
  22. }
  23.  
  24. addGlobalStyle(' a, a:link { color: ' + COLOR_BLUE + ' !important; text-decoration: underline !important } ');
  25. addGlobalStyle(' a:hover, a:link:hover { color: '+ COLOR_BLUE + ' !important; text-decoration: none !important } ');
  26. addGlobalStyle(' a:visited { color: ' + COLOR_PURPLE + ' !important; text-decoration: underline !important } ');
  27. addGlobalStyle(' a:visited:hover { color: ' + COLOR_PURPLE + ' !important; text-decoration: none !important } ');