您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
新版bilibili把連結嵌入屬性,導致無法右/中鍵直接開啟😡
// ==UserScript== // @name BiliBili 連結復原 // @namespace Anong0u0 // @version 0.1.5 // @description 新版bilibili把連結嵌入屬性,導致無法右/中鍵直接開啟😡 // @author Anong0u0 // @match https://www.bilibili.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com // @require https://cdn.jsdelivr.net/npm/[email protected]/minified/arrive.min.js // @grant none // @run-at document-start // @license beerware // ==/UserScript== Node.prototype.changeTag = function (tag) { const clone = document.createElement(tag) for (const attr of this.attributes) clone.setAttributeNS(null, attr.name, attr.value) while (this.firstChild) clone.appendChild(this.firstChild) this.replaceWith(clone) return clone } document.arrive("a[data-url]", (e) => { const link = e.getAttribute("data-url").match(/(?<=keyword=)[^&]+/) e.href = link ? `https://search.bilibili.com/all?keyword=${link}` : e.getAttribute("data-url") e.target = "_blank" }) document.arrive("a[data-user-id]", (e) => { e.href = `https://space.bilibili.com/${e.getAttribute("data-user-id")}` e.target = "_blank" }) document.arrive("div[data-user-id]", (e) => { e.changeTag("a") e.href = `https://space.bilibili.com/${e.getAttribute("data-user-id")}` e.target = "_blank" })