Disable AV1 in non-chromium browsers

This commit is contained in:
shirt 2022-05-09 08:01:25 -04:00
parent 2a06fa2286
commit a7bb37d62f
Signed by: shirt
GPG key ID: 961246C6493C8DF9
2 changed files with 23 additions and 4 deletions

View file

@ -2,6 +2,20 @@
// This script runs as a drop-in replacement of the original cadmium-playercore. This is not a content script.
console.log("Netflix International script active!");
/* eslint-disable no-undef */
// https://stackoverflow.com/a/45985333
function getBrowser() {
if (typeof chrome !== "undefined") {
if (typeof browser !== "undefined") {
return "Firefox";
} else {
return "Chrome";
}
} else {
return "Edge";
}
}
function do_patch(desc, needle, replacement) {
var match = cadmium_src.match(needle);
if (!match) {
@ -79,10 +93,15 @@ function get_profile_list() {
"vp9-profile0-L30-dash-cenc",
"vp9-profile0-L31-dash-cenc",
"vp9-profile0-L40-dash-cenc",
"av1-main-L30-dash-cbcs-prk",
"av1-main-L31-dash-cbcs-prk",
"av1-main-L40-dash-cbcs-prk",
]);
if (getBrowser() == "Chrome") {
custom_profiles = custom_profiles.concat([
"av1-main-L30-dash-cbcs-prk",
"av1-main-L31-dash-cbcs-prk",
"av1-main-L40-dash-cbcs-prk",
]);
}
}
custom_profiles = custom_profiles.concat([

View file

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Netflix International",
"description": "Displays all available Netflix audio and subtitle tracks.",
"version": "2.0.13",
"version": "2.0.14",
"author": "shirt",
"browser_action": {
"default_icon": "img/icon128.png",