您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
阻止b站修改buvid3以退回旧版首页2023/08/26
当前为
// ==UserScript== // @name bilibili旧版首页2023/08/26 // @namespace http://tampermonkey.net/ // @version 0.1.1 // @description 阻止b站修改buvid3以退回旧版首页2023/08/26 // @author 飘过的风 // @license MIT // @match *://*.bilibili.com/* // @icon https://www.bilibili.com/favicon.ico // @grant none // ==/UserScript== (function () { 'use strict'; const blockedCookieNames = ['buvid3', 'otherCookieYouWantToBlock']; // Add or remove cookie names from this lista as needed // Delete the cookies if they're already set blockedCookieNames.forEach((cookieName) => { if (document.cookie.includes(cookieName + '=')) { document.cookie = `${cookieName}=; domain=.bilibili.com; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`; } }); // Override document.cookie to prevent setting blocked cookies const originalDocumentCookie = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie') || Object.getOwnPropertyDescriptor(HTMLDocument.prototype, 'cookie'); Object.defineProperty(document, 'cookie', { get: function () { return originalDocumentCookie.get.call(document); }, set: function (value) { const cookieNameBeingSet = value.split('=')[0].trim(); if (!blockedCookieNames.includes(cookieNameBeingSet)) { originalDocumentCookie.set.call(document, value); } }, }); })();