Bilibili 解鎖杜比全景聲 & 8K & 開啟 HDR & 直播畫質PRO

為 B站 Windows 平台 解鎖杜比全景聲 & 8K &開啟 HDR &直播畫質PRO

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name               Bilibili 解鎖杜比全景聲 & 8K & 開啟 HDR & 直播畫質PRO
// @name:zh-CN         Bilibili 解锁杜比全景声 & 8K & 开启 HDR & 直播画质PRO
// @version            2.7.1.1.8
// @description        為 B站 Windows 平台 解鎖杜比全景聲 & 8K &開啟 HDR &直播畫質PRO
// @description:zh-CN  为 B站 Windows 平台 解锁杜比全景声 & 8K &开启 HDR &直播画质PRO
// @author             AlexLI(tkp206093)
// @namespace          https://greasyfork.org/zh-TW/users/150638-tkp206093
// @homepageURL        https://greasyfork.org/zh-TW/scripts/441403
// @supportURL         https://greasyfork.org/zh-TW/scripts/441403/feedback
// @match              *://www.bilibili.com/blackboard/html5playerhelp*
// @match              *://www.bilibili.com/video*
// @match              *://www.bilibili.com/list*
// @match              *://www.bilibili.com/blackboard*
// @match              *://www.bilibili.com/watchlater*
// @match              *://www.bilibili.com/bangumi*
// @match              *://www.bilibili.com/watchroom*
// @match              *://www.bilibili.com/medialist*
// @match              *://www.bilibili.com/festival*
// @match              *://bangumi.bilibili.com*
// @match              *://live.bilibili.com/*
// @icon               https://www.google.com/s2/favicons?domain=bilibili.com
// @license            MIT
// @run-at             document-start
// @grant              none
// ==/UserScript==
(function() {
    window.localStorage['bilibili_player_force_DolbyAtmos&8K&HDR'] = 1;
    // B站內置強制開關
    window.localStorage.bilibili_player_force_hdr = 1;
    'use strict'
    const originalSetItem = sessionStorage.getItem;
    sessionStorage.getItem = function(key) {
        // 部分視頻解碼錯誤後會強制全局回退,禁用所有HEVC內容
        // 此hook禁用對應邏輯
        if (key === 'enableHEVCError') {
            return undefined;
        }
        return originalSetItem.apply(this,arguments);
    };
    Object.defineProperty(navigator, 'userAgent', {
        value: "Mozilla/5.0 (Macintosh; Intel Mac OS X 15_7_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15"
    });
})();