Netflix 4K

针对 Netflix 伪造 4K 分辨率支持

目前為 2022-04-28 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Netflix 4K
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  针对 Netflix 伪造 4K 分辨率支持
// @author       TGSAN
// @match        https://www.netflix.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=netflix.com
// @run-at       document-start
// @grant        unsafeWindow
// ==/UserScript==

(function() {
    // 'use strict';

    delete unsafeWindow.screen;
    unsafeWindow.__defineGetter__('screen',function(){
        let s=[];
        s['width']=3840;
        s['height']=2160;
        s['availWidth']=3840;
        s['availHeight']=2160;
        s['availLeft']=0;
        s['availTop']=0;
        s['colorDepth']=32;
        s['isExtended']=false;
        s['pixelDepth']=32;
        return s;
    })

    delete unsafeWindow.devicePixelRatio;
    unsafeWindow.devicePixelRatio = 4;

    // window.MSMediaKeys.isTypeSupportedWithFeaturesOriginal = MSMediaKeys.isTypeSupportedWithFeatures;
    // window.MSMediaKeys.isTypeSupportedWithFeatures = function (a, b) {
    //     const reg = /,display-res-[x|y]=\d+?,display-res-[x|y]=\d+?/
    //     b = b.replace(reg, "");
    //     if (this.isTypeSupportedWithFeaturesOriginal(a, b) !== '') console.log("Hook MSMediaKeys isTypeSupportedWithFeatures:", a, b);
    //     return "probably";
    // }
})();