greasyfork. APPLIES TO LINKS SEARCH BY SITES

greasyfork.org. makes applies to “All site” link to the “*” by site search (JasonBarnabe/greasyfork#146)

当前为 2023-11-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name greasyfork. APPLIES TO LINKS SEARCH BY SITES
  3. // @version 2016.6.15
  4. // @changelog https://github.com/jesus2099/konami-command/commits/master/greasyfork_APPLIES-TO-LINKS-SEARCH-BY-SITES.user.js
  5. // @description greasyfork.org. makes applies to “All site” link to the “*” by site search (JasonBarnabe/greasyfork#146)
  6. // @supportURL https://github.com/jesus2099/konami-command/labels/greasyfork_APPLIES-TO-LINKS-SEARCH-BY-SITES
  7. // @compatible opera(12.18.1872)+violentmonkey my setup
  8. // @namespace https://github.com/jesus2099/konami-command
  9. // @author PATATE12
  10. // @licence CC BY-NC-SA 3.0 (https://creativecommons.org/licenses/by-nc-sa/3.0/)
  11. // @since 2014-06-06
  12. // @icon data:image/gif;base64,R0lGODlhEAAQAKEDAP+/3/9/vwAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh/glqZXN1czIwOTkAIfkEAQACAwAsAAAAABAAEAAAAkCcL5nHlgFiWE3AiMFkNnvBed42CCJgmlsnplhyonIEZ8ElQY8U66X+oZF2ogkIYcFpKI6b4uls3pyKqfGJzRYAACH5BAEIAAMALAgABQAFAAMAAAIFhI8ioAUAIfkEAQgAAwAsCAAGAAUAAgAAAgSEDHgFADs=
  13. // @grant none
  14. // @match *://greasyfork.org/*/scripts/*
  15. // @match *://greasyfork.org/scripts/*
  16. // @exclude *://greasyfork.org/*/scripts/*/*
  17. // @exclude *://greasyfork.org/*/scripts/?
  18. // @exclude *://greasyfork.org/*/scripts/by*
  19. // @exclude *://greasyfork.org/scripts/*/*
  20. // @exclude *://greasyfork.org/scripts/?
  21. // @exclude *://greasyfork.org/scripts/by*
  22. // @run-at document-end
  23. // ==/UserScript==
  24. "use strict";
  25. var appliesto = document.querySelector("div#script-meta dd.script-show-applies-to");
  26. if (appliesto) {
  27. var text = appliesto.textContent.trim();
  28. if (text.match(/^(all sites|alle seiten|todos los sitios|tous les sites|semua situs|すべてのサイト|alle websites|wszystkie strony|todos sites|все сайты|所有站点|所有網站)$/i)) {
  29. appliesto.replaceChild(appliestoLink(text, "*"), appliesto.firstChild);
  30. }
  31. }
  32. function appliestoLink(text, site) {
  33. var a = document.createElement("a");
  34. a.setAttribute("href", "/scripts/by-site/" + (site ? site : text));
  35. a.appendChild(document.createTextNode(text));
  36. return a;
  37. }