您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在BT4G搜索页面标题后直接添加磁力链接跳转链接
当前为
// ==UserScript== // @name bt4g添加磁力链接 // @namespace [email protected] // @version 0.1.0 // @description 在BT4G搜索页面标题后直接添加磁力链接跳转链接 // @match *://*.bt4g.org/search/* // @author Xiccnd // @license GPL-3.0 License // @require https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js // @icon https://cdn.jsdelivr.net/gh/Xiccnd/Xiccnd-Pic@master/20220421113011992.1vh7zbll47r4.ico // @grant none // ==/UserScript== $(function () { 'use strict' /* * 开启或关闭脚本功能 * */ //开启添加磁力链接 xiccndAddMagnet() /* * 添加磁力链接功能 * */ function xiccndAddMagnet() { //在标题后添加 $('h5 a').on('mouseover', function () {//鼠标悬停事件 //判断是否已添加a标签 if (!($(this).next().length > 0)) { //获取链接 const URL = $(this).attr('href') //合成磁力链接 const SRC = 'magnet:?xt=urn:btih:' + URL.substr(8) //生成a标签 const A = '<a style="color: red" target="_blank">磁力链接</a>' //添加a标签 $(this).parent('h5').append(A) //a标签绑定事件 $(this).next().on('click', function () { //a标签添加磁力链接 $(this).attr('href', SRC) }).on('mouseover', function () { $(this).css('cursor', 'pointer').css('color', 'pink') }).on('mouseout', function () { $(this).css('color', 'red') }) } }).trigger('mouseover')//全部触发 } })