mirror of
https://github.com/shirt-dev/netflix-international.git
synced 2025-06-22 00:36:43 +00:00
v2.0.3
Cleaned up code, fixed CSS issues caused by Netflix update
This commit is contained in:
parent
4383594d23
commit
2380097d45
7 changed files with 100 additions and 65 deletions
|
@ -1,18 +1,7 @@
|
|||
/* eslint-disable no-undef */
|
||||
// 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!");
|
||||
|
||||
// promisify chrome storage API for easier chaining
|
||||
function chromeStorageGet(opts) {
|
||||
if (getBrowser() == "Firefox") {
|
||||
return chrome.storage.sync.get(opts);
|
||||
}
|
||||
else {
|
||||
return new Promise(resolve => {
|
||||
chrome.storage.sync.get(opts, resolve);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function do_patch(desc, needle, replacement) {
|
||||
var match = cadmium_src.match(needle);
|
||||
if (!match) {
|
||||
|
@ -35,8 +24,9 @@ request.send();
|
|||
|
||||
var cadmium_src = request.responseText;
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function get_profile_list() {
|
||||
custom_profiles = [
|
||||
var custom_profiles = [
|
||||
"playready-h264mpl30-dash",
|
||||
"playready-h264mpl31-dash",
|
||||
"playready-h264mpl40-dash",
|
||||
|
@ -82,11 +72,11 @@ do_patch(
|
|||
"Custom profiles 2",
|
||||
/(name:"default",profiles:).}/,
|
||||
"$1 get_profile_list()}"
|
||||
)
|
||||
);
|
||||
|
||||
do_patch(
|
||||
"Re-enable Ctrl+Shift+Alt+S menu",
|
||||
/this\...\....\s*\&\&\s*this\.toggle\(\);/,
|
||||
/this\...\....\s*&&\s*this\.toggle\(\);/,
|
||||
"this.toggle();"
|
||||
);
|
||||
|
||||
|
@ -94,7 +84,7 @@ if (globalOptions.showAllTracks) {
|
|||
do_patch("Show all audio tracks",
|
||||
/"showAllSubDubTracks",!1/,
|
||||
"\"showAllSubDubTracks\",!0"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// run our patched copy of playercore in a non-privileged context on the page
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue