您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Modify Bilibili links to open in the current tab
// ==UserScript== // @name Bilibili Link Modifier // @namespace http://tampermonkey.net/ // @version 0.1 // @description Modify Bilibili links to open in the current tab // @author ChatGPT(chat.openai.com) // @match *://*.bilibili.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to modify the link behavior function modifyLinks() { const links = document.querySelectorAll('a'); links.forEach(link => { link.setAttribute('target', '_self'); }); } // Execute the function to modify the links modifyLinks(); // Optionally, re-execute the function when new content is loaded into the page (like when scrolling) let lastHeight = document.body.clientHeight; setInterval(() => { if (document.body.clientHeight > lastHeight) { modifyLinks(); lastHeight = document.body.clientHeight; } }, 1000); })();