您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Bangumi 多域名悬浮跳转
当前为
// ==UserScript== // @name multi-domain-redirect // @namespace https://gf.qytechs.cn/users/1203219 // @author harutya // @match *://bgm.tv/* // @match *://bangumi.tv/* // @match *://chii.in/* // @license MIT // @version 0.0.1 // @description Bangumi 多域名悬浮跳转 // ==/UserScript== (() => { 'use strict'; // Check if the current window is the top window if (window.self != window.top) { return; } createFloatingMenu(); function createFloatingMenu() { const wrapper = document.createElement('div'); wrapper.id = 'multiDomainMenuWrapper'; const menu = document.createElement('div'); menu.id = 'multiDomainMenu'; // Define the domains and paths const domains = { 'bgm.tv': ['bangumi.tv', 'chii.in'], 'bangumi.tv': ['chii.in', 'bgm.tv'], 'chii.in': ['bgm.tv', 'bangumi.tv'] }; // Get the current domain const currentDomain = window.location.hostname; // Create links for other domains for (const targetDomain of domains[currentDomain]) { const link = document.createElement('a'); link.href = window.location.href.replace(currentDomain, targetDomain); link.textContent = targetDomain; link.style.color = '#F09199'; menu.appendChild(link); } // Create the Go button const goButton = document.createElement('div'); goButton.id = 'goButton'; goButton.textContent = 'Go'; // Show menu on hover goButton.addEventListener('mouseenter', () => { menu.style.display = 'flex'; }); // Hide menu when leaving the wrapper wrapper.addEventListener('mouseleave', () => { menu.style.display = 'none'; }); wrapper.appendChild(goButton); wrapper.appendChild(menu); document.body.appendChild(wrapper); // Hide menu initially menu.style.display = 'none'; // Add click event to Go button goButton.addEventListener('click', () => { // Find the first link inside the menu and navigate to it const firstLink = menu.querySelector('a'); if (firstLink) { window.location.href = firstLink.href; } }); } // Add styles to head const style = document.createElement('style'); style.textContent = ` #multiDomainMenuWrapper { position: fixed; top: 40%; left: 0; transform: translateY(-50%); z-index: 9999; cursor: pointer; } #multiDomainMenu { display: none; background-color: #fff; border: 1px solid #ccc; padding: 5px; display: flex; flex-direction: column; gap: 3px; position: absolute; top: 100%; left: 0; border-radius: 5px; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); } #multiDomainMenu a { text-decoration: none; padding: 3px; } #goButton { border: 1px solid #ccc; padding: 5px; border-radius: 5px; background-color: #fff; color: #F09199; } `; document.head.appendChild(style); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址