您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
获取当前页面的主域名并打开 GreasyFork 查找脚本
- // ==UserScript==
- // @name GreasyFork Script Finder
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description 获取当前页面的主域名并打开 GreasyFork 查找脚本
- // @author Felix
- // @license AGPL-3.0
- // @match *://*/*
- // @grant GM_registerMenuCommand
- // @grant GM_openInTab
- // ==/UserScript==
- (function() {
- 'use strict';
- // 注册(不可用)菜单命令
- GM_registerMenuCommand("查找该域名的GreasyFork脚本", function() {
- // 获取当前页面的完整域名
- const domain = window.location.hostname;
- // 使用正则表达式提取主域名
- const mainDomain = domain.replace(/^.*\.(?:com|org|net|gov|edu|io|co|info|me|tv)(?:\.[a-z]{2,})?$/, "$&").split('.').slice(-2).join('.');
- // 生成 GreasyFork 搜索链接
- const url = `https://gf.qytechs.cn/zh-CN/scripts/by-site/${mainDomain}`;
- // 在新标签页中打开该链接
- GM_openInTab(url, { active: true });
- });
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址