Greasy Fork is available in English.

Userscript Utilities

Adds functionality to interact with Greasy Fork and Chrome Web Store.

  1. // ==UserScript==
  2. // @name Userscript Utilities
  3. // @namespace https://github.com/AmeLooksSus
  4. // @version 1.0
  5. // @description Adds functionality to interact with Greasy Fork and Chrome Web Store.
  6. // @icon https://i.imgur.com/LXyAydx.png
  7. // @author AmeLooksSus
  8. // @match *://*/*
  9. // @grant GM_registerMenuCommand
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. // Choose the filter for Greasy Fork: updated, created, total_installs, ratings, or name.
  16. var filter = "updated";
  17. // To enable CSS filtering, uncomment the line below and optionally specify "all" to view both javascript and css. Remember to add "+ language" before the semicolon(;) in line 27
  18. // var language = "css";
  19.  
  20. if (typeof GM_registerMenuCommand === 'function') {
  21. GM_registerMenuCommand('Greasy Fork: ' + filter, function() {
  22. // Get the base domain of the website
  23. var hostname = window.location.hostname;
  24. // Remove subdomains like www from the hostname
  25. var baseDomain = hostname.replace(/^[^.]+\./, '');
  26. // Create the modified link for Greasy Fork
  27. var modifiedLink = 'https://greasyfork.org/en/scripts/by-site/' + baseDomain + '?sort=' + filter;
  28. // Open the modified link in a new tab
  29. window.open(modifiedLink, '_blank');
  30. });
  31. GM_registerMenuCommand('Extensions', function() {
  32. // Get the base domain of the website
  33. var baseDomain = window.location.hostname.match(/([^.]+)\.\w{2,3}(?:\.\w{2})?$/)[1];
  34. // Create the modified link for Chrome Web Store extensions
  35. var modifiedLink = 'https://chromewebstore.google.com/search/' + baseDomain + '?itemTypes=EXTENSION';
  36. // Open the modified link in a new tab
  37. window.open(modifiedLink, '_blank');
  38. });
  39. GM_registerMenuCommand('Themes', function() {
  40. // Get the base domain of the website
  41. var baseDomain = window.location.hostname.match(/([^.]+)\.\w{2,3}(?:\.\w{2})?$/)[1];
  42. // Create the modified link for Chrome Web Store themes
  43. var modifiedLink = 'https://chromewebstore.google.com/search/' + baseDomain + '?itemTypes=THEME';
  44. // Open the modified link in a new tab
  45. window.open(modifiedLink, '_blank');
  46. });
  47. GM_registerMenuCommand('Both', function() {
  48. // Get the base domain of the website
  49. var baseDomain = window.location.hostname.match(/([^.]+)\.\w{2,3}(?:\.\w{2})?$/)[1];
  50. // Create the modified link for Chrome Web Store both extensions and themes
  51. var modifiedLink = 'https://chromewebstore.google.com/search/' + baseDomain + '?itemTypes=EXTENSION%2CTHEME';
  52. // Open the modified link in a new tab
  53. window.open(modifiedLink, '_blank');
  54. });
  55. }
  56. })();