From 4b1903d226c546074a542225063a9e8d1087c7c4 Mon Sep 17 00:00:00 2001 From: Jan Scheiper Date: Tue, 22 Sep 2020 02:14:52 +0200 Subject: [PATCH] version 1.22.0: ported a feature from the firefox version of this plugin, which allows us to disable the VP9 codec and get higher bitrates (thanks @TheGoddessInari) --- cadmium-playercore-6.0025.369.012-1080p.js | 9 +++++---- content_script.js | 3 ++- manifest.json | 2 +- pages/options.html | 10 +++++----- pages/options.js | 19 ++++++++++++------- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/cadmium-playercore-6.0025.369.012-1080p.js b/cadmium-playercore-6.0025.369.012-1080p.js index 4104a7c..bea7591 100644 --- a/cadmium-playercore-6.0025.369.012-1080p.js +++ b/cadmium-playercore-6.0025.369.012-1080p.js @@ -59336,9 +59336,6 @@ a000.x6A = (function(I6A) { "playready-h264hpl30-dash", "playready-h264hpl31-dash", "playready-h264hpl40-dash", - "vp9-profile0-L30-dash-cenc", - "vp9-profile0-L31-dash-cenc", - "vp9-profile0-L40-dash-cenc", "heaac-2-dash", "heaac-2hq-dash", "simplesdh", @@ -59347,7 +59344,11 @@ a000.x6A = (function(I6A) { "BIF320" ]; - if(globalOptions.use6Channels) { + if (!globalOptions.disableVP9) { + profiles.push("vp9-profile0-L21-dash-cenc", "vp9-profile0-L30-dash-cenc", "vp9-profile0-L31-dash-cenc", "vp9-profile0-L40-dash-cenc"); + } + + if (globalOptions.use6Channels) { profiles.push("heaac-5.1-dash"); } diff --git a/content_script.js b/content_script.js index e4d3f64..74364e5 100755 --- a/content_script.js +++ b/content_script.js @@ -29,7 +29,8 @@ function attachScript(resp) { chromeStorageGet({ use6Channels: true, - setMaxBitrate: true + setMaxBitrate: true, + disableVP9: false, }).then(items => { // very messy workaround for accessing chrome storage outside of background / content scripts let mainScript = document.createElement('script'); diff --git a/manifest.json b/manifest.json index 3827662..dc3560d 100755 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Netflix 1080p", "description": "Forces 1080p and 5.1 playback for Netflix.", - "version": "1.21.0", + "version": "1.22.0", "author": "truedread", "browser_action": { "default_icon": "img/icon128.png" diff --git a/pages/options.html b/pages/options.html index 1da0426..7969d11 100755 --- a/pages/options.html +++ b/pages/options.html @@ -6,11 +6,11 @@ - + +
+ +
+
diff --git a/pages/options.js b/pages/options.js index 87e66ce..8d24858 100755 --- a/pages/options.js +++ b/pages/options.js @@ -1,9 +1,12 @@ function save_options() { - var use6Channels = document.getElementById('5.1').checked; - var setMaxBitrate = document.getElementById('setMaxBitrate').checked; + const use6Channels = document.getElementById("use51").checked; + const setMaxBitrate = document.getElementById("setMaxBitrate").checked; + const disableVP9 = document.getElementById("disableVP9").checked; + chrome.storage.sync.set({ - use6Channels: use6Channels, - setMaxBitrate: setMaxBitrate + use6Channels, + setMaxBitrate, + disableVP9, }, function() { var status = document.getElementById('status'); status.textContent = 'Options saved.'; @@ -16,10 +19,12 @@ function save_options() { function restore_options() { chrome.storage.sync.get({ use6Channels: true, - setMaxBitrate: true + setMaxBitrate: true, + disableVP9: false, }, function(items) { - document.getElementById('5.1').checked = items.use6Channels; - document.getElementById('setMaxBitrate').checked = items.setMaxBitrate; + document.getElementById("use51").checked = items.use6Channels; + document.getElementById("setMaxBitrate").checked = items.setMaxBitrate; + document.getElementById("disableVP9").checked = items.disableVP9; }); }