Keep your text-selection color the same on all websites.

Changes the background highlight color that is displayed, whenever you highlight text on any Web page.

目前為 2021-06-03 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Keep your text-selection color the same on all websites.
  3. // @description Changes the background highlight color that is displayed, whenever you highlight text on any Web page.
  4. // @author dhaden, modifying an old Stylish userstyle from Ashish Bachavala
  5. // @match *://*/*
  6. // @version 1.0
  7. // @namespace https://greasyfork.org/users/186630
  8. // ==/UserScript==
  9. (function() {var css = [
  10. "::selection {",
  11. " background: #0073e6;",
  12. " color: #ffffff;",
  13. " text-decoration: none;",
  14. "}"
  15. ].join("\n");
  16. if (typeof GM_addStyle != "undefined") {
  17. GM_addStyle(css);
  18. } else if (typeof PRO_addStyle != "undefined") {
  19. PRO_addStyle(css);
  20. } else if (typeof addStyle != "undefined") {
  21. addStyle(css);
  22. } else {
  23. var node = document.createElement("style");
  24. node.type = "text/css";
  25. node.appendChild(document.createTextNode(css));
  26. var heads = document.getElementsByTagName("head");
  27. if (heads.length > 0) {
  28. heads[0].appendChild(node);
  29. } else {
  30. // no head yet, stick it whereever
  31. document.documentElement.appendChild(node);
  32. }
  33. }
  34. })();