Greasy Fork

Greasy Fork is available in English.

哔哩哔哩(B站)自动回到旧版页面

通过每次进入页面时更改cookie来使哔哩哔哩自动回到旧版页面

目前为 2022-12-15 提交的版本。查看 最新版本

// ==UserScript==
// @name               哔哩哔哩(B站)自动回到旧版页面
// @description        通过每次进入页面时更改cookie来使哔哩哔哩自动回到旧版页面
// @author             Tinhone
// @namespace          让我们对新版页面使用炎拳吧
// @license            GPL-3.0
// @version            1.2.0
// @icon               https://app.bilibili.com/favicon.ico
// @compatible         firefox V35+
// @compatible         edge V35+
// @compatible         chrome V35+
// @match              *://www.bilibili.com/*
// ==/UserScript==

(function() {
    'use strict'
    //先赋值,运行速度更快
    const temp233Cookie=document.cookie
    const temp233A=/i-wanna-go-back\=2/
    const temp233B=/go_old_video\=1/
    const temp233C=/nostalgia_conf\=2/
    const temp233D=/ogv_channel_version\=v1/
    if (!(temp233A.test(temp233Cookie) && temp233B.test(temp233Cookie) && temp233C.test(temp233Cookie) && temp233D.test(temp233Cookie))){
        document.cookie='i-wanna-go-back=2; expires=Fri, 1 Jan 2077 00:00:00 GMT; domain=bilibili.com; path=/'
        document.cookie='go_old_video=1; expires=Fri, 1 Jan 2077 00:00:00 GMT; domain=bilibili.com; path=/'
        document.cookie='nostalgia_conf=2; expires=Fri, 1 Jan 2077 00:00:00 GMT; domain=bilibili.com; path=/'
        document.cookie='ogv_channel_version=v1; expires=Fri, 1 Jan 2077 00:00:00 GMT; domain=bilibili.com; path=/'
        location.reload()
    }
})()