diff --git a/cadmium-playercore-shim.js b/cadmium-playercore-shim.js index 9aa111b..9a67704 100644 --- a/cadmium-playercore-shim.js +++ b/cadmium-playercore-shim.js @@ -105,6 +105,11 @@ function get_profile_list() { return custom_profiles; } +// eslint-disable-next-line no-unused-vars +function get_preferred_locale() { + return globalOptions.preferredLocale; +} + do_patch( "Hello world", /(.*)/, @@ -136,5 +141,17 @@ if (globalOptions.showAllTracks) { ); } +do_patch( + "Set preferred audio locale", + /preferredAudioLocale:.\.preferredAudioLocale/, + "preferredAudioLocale: get_preferred_locale()" +); + +do_patch( + "Set preferred text locale", + /preferredTextLocale:.\.preferredTextLocale/, + "preferredTextLocale: get_preferred_locale()" +); + // run our patched copy of playercore in a non-privileged context on the page window.Function(cadmium_src)(); diff --git a/content_script.js b/content_script.js index 8e83fec..ba63a0c 100644 --- a/content_script.js +++ b/content_script.js @@ -47,6 +47,7 @@ chromeStorageGet({ setMaxBitrate: false, disableVP9: false, useDDPlus: false, + preferredLocale: "en", }).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 eca9399..19b17ff 100644 --- a/manifest.json +++ b/manifest.json @@ -2,10 +2,11 @@ "manifest_version": 2, "name": "Netflix International", "description": "Displays all available Netflix audio tracks.", - "version": "2.0.9", + "version": "2.0.10", "author": "shirt", "browser_action": { - "default_icon": "img/icon128.png" + "default_icon": "img/icon128.png", + "default_popup": "pages/options.html" }, "browser_specific_settings": { "gecko": { diff --git a/pages/options.html b/pages/options.html index 0f4cc16..d1efd82 100644 --- a/pages/options.html +++ b/pages/options.html @@ -3,6 +3,11 @@