Search Scripts on GreasyFork/Sleazyfork

Search GleasyFork or Sleasyforks for scripts of the current site

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Search Scripts on GreasyFork/Sleazyfork
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Search GleasyFork or Sleasyforks for scripts of the current site
// @author       You
// @match        *://*/*
// @license MIT
// @grant        GM_openInTab
// @grant        GM_registerMenuCommand
// ==/UserScript==

(function() {
    'use strict';
    
    let domain = window.location.hostname;
    // www.を削除
    if (domain.startsWith('www.')) {
        domain = domain.substring(4);
    }
    
    // GreasyForkで検索
    if (typeof GM_registerMenuCommand !== 'undefined') {
        GM_registerMenuCommand(`Search GreasyFork for ${domain}`, function() {
            const url = `https://greasyfork.org/ja/scripts/by-site/${domain}?filter_locale=0`;
            GM_openInTab(url, false);
        });
        
        // Sleazyforkで検索
        GM_registerMenuCommand(`Search Sleazyfork for ${domain}`, function() {
            const url = `https://sleazyfork.org/ja/scripts/by-site/${domain}?filter_locale=0`;
            GM_openInTab(url, false);
        });
    }
})();