Search Scripts on GreasyFork/Sleazyfork

Search GleasyFork or Sleasyforks for scripts of the current site

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
        });
    }
})();