Fix indentation, bump version

This commit is contained in:
shirtjs 2021-09-08 10:51:45 -04:00
parent 28b4b01913
commit 099dfd0107
3 changed files with 70 additions and 68 deletions

View file

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

View file

@ -1,3 +1,4 @@
/* eslint-disable no-undef */
let getElementByXPath = function (xpath) { let getElementByXPath = function (xpath) {
return document.evaluate( return document.evaluate(
xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null
@ -5,7 +6,7 @@ let getElementByXPath = function (xpath) {
}; };
const fn = function () { const fn = function () {
window.dispatchEvent(new KeyboardEvent('keydown', { window.dispatchEvent(new KeyboardEvent("keydown", {
keyCode: 83, keyCode: 83,
ctrlKey: true, ctrlKey: true,
altKey: true, altKey: true,
@ -23,13 +24,13 @@ const fn = function () {
[VIDEO_SELECT, AUDIO_SELECT].forEach(function (el) { [VIDEO_SELECT, AUDIO_SELECT].forEach(function (el) {
let parent = el.parentElement; let parent = el.parentElement;
let options = parent.querySelectorAll('select > option'); let options = parent.querySelectorAll("select > option");
for (var i = 0; i < options.length - 1; i++) { for (var i = 0; i < options.length - 1; i++) {
options[i].removeAttribute('selected'); options[i].removeAttribute("selected");
} }
options[options.length - 1].setAttribute('selected', 'selected'); options[options.length - 1].setAttribute("selected", "selected");
}); });
BUTTON.click(); BUTTON.click();

View file

@ -1,3 +1,4 @@
/* eslint-disable no-undef */
function save_options() { function save_options() {
const use6Channels = document.getElementById("use51").checked; const use6Channels = document.getElementById("use51").checked;
const showAllTracks = document.getElementById("showAllTracks").checked; const showAllTracks = document.getElementById("showAllTracks").checked;
@ -10,10 +11,10 @@ function save_options() {
setMaxBitrate, setMaxBitrate,
disableVP9, disableVP9,
}, function() { }, function() {
var status = document.getElementById('status'); var status = document.getElementById("status");
status.textContent = 'Options saved.'; status.textContent = "Options saved.";
setTimeout(function() { setTimeout(function() {
status.textContent = ''; status.textContent = "";
}, 750); }, 750);
}); });
} }
@ -32,5 +33,5 @@ function restore_options() {
}); });
} }
document.addEventListener('DOMContentLoaded', restore_options); document.addEventListener("DOMContentLoaded", restore_options);
document.getElementById('save').addEventListener('click', save_options); document.getElementById("save").addEventListener("click", save_options);