Greasy Fork镜像 is available in English.

Netflix 4K

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

Tính đến 28-04-2022. Xem phiên bản mới nhất.

// ==UserScript==
// @name         Netflix 4K
// @namespace    http://tampermonkey.net/
// @version      0.3
// @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';

    if (this.unsafeWindow) {
        console.log("use unsafeWindow mode");
        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;
    } else {
        console.log("use window mode");
        delete window.screen;
        window.__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 window.devicePixelRatio;
        window.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";
    // }
})();
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元