Down to the last of the linter errors, most of the remainder are false-positives

This commit is contained in:
idk
2020-01-04 10:29:41 -05:00
parent c222b4ed0b
commit 2e9ae83daa
7 changed files with 40 additions and 28 deletions

View File

@@ -232,7 +232,7 @@ fmt:
find . -path ./node_modules -prune -o -name '*.json' -exec prettier --write {} \;
lint:
eslint --color *.js
eslint --fix --color *.js
deborig: fmt version
rm -rf ../i2psetproxy.js-$(VERSION)

View File

@@ -265,12 +265,10 @@ function themeWindow(window) {
browser.contextualIdentities
.get(tabInfo[0].cookieStoreId)
.then(onContextGotTheme, onThemeError);
} else if (isEmpty(oldtheme)) {
browser.theme.reset();
} else {
if (isEmpty(oldtheme)) {
browser.theme.reset();
} else {
browser.theme.update(window.id, oldtheme);
}
browser.theme.update(window.id, oldtheme);
}
}

View File

@@ -33,7 +33,10 @@ function eventHandler(event) {
}
function createOptions(node, identity) {
for (let option of ["Create", "Close All"]) {
for (let option of [
"Create",
"Close All"
]) {
let alink = document.createElement("a");
alink.href = "#";
alink.innerText = option;

View File

@@ -55,6 +55,8 @@ document.addEventListener("click", clickEvent => {
}
refreshIdentity();
} else if (clickEvent.target.id === "window-preface-title") {
console.log("attempting to create homepage tab");
goHome();
} else if (clickEvent.target.id === "window-visit-homepage") {
console.log("attempting to create homepage tab");
goHome();

View File

@@ -167,7 +167,7 @@ function AssurePeerConnection() {
value: "proxy_only"
});
}
rtc = browser.privacy.network.peerConnectionEnabled.get({});
let rtc = browser.privacy.network.peerConnectionEnabled.get({});
rtc.then(assure);
}
@@ -199,7 +199,13 @@ function EnableSavePasswords() {
var defaultSettings = {
since: "forever",
dataTypes: ["downloads", "passwords", "formData", "localStorage", "history"]
dataTypes: [
"downloads",
"passwords",
"formData",
"localStorage",
"history"
]
};
function onError(therror) {

View File

@@ -181,11 +181,11 @@ function SetupSettings() {
//
function checkHostStoredSettings(storedSettings) {
if (storedSettings.proxy_host != undefined) {
proxy_host = storedSettings.proxy_host;
} else {
if (storedSettings.proxy_host == undefined) {
proxy_host = "127.0.0.1";
storedSettings.proxy_host = proxy_host;
} else {
proxy_host = storedSettings.proxy_host;
}
console.log("Initialising Host", storedSettings.proxy_host);
setupProxy();
@@ -195,11 +195,11 @@ function SetupSettings() {
//
function checkPortStoredSettings(storedSettings) {
if (storedSettings.proxy_port != undefined) {
proxy_port = storedSettings.proxy_port;
} else {
if (storedSettings.proxy_port == undefined) {
proxy_port = "4444";
storedSettings.proxy_port = proxy_port;
} else {
proxy_port = storedSettings.proxy_port;
}
console.log("Initialising Port", storedSettings.proxy_port);
setupProxy();
@@ -209,11 +209,11 @@ function SetupSettings() {
//
function checkControlHostStoredSettings(storedSettings) {
if (storedSettings.control_host != undefined) {
control_host = storedSettings.control_host;
} else {
if (storedSettings.control_host == undefined) {
control_host = "127.0.0.1";
storedSettings.control_host = control_host;
} else {
control_host = storedSettings.control_host;
}
console.log("Initialising Control Host", storedSettings.control_host);
setupProxy();
@@ -228,11 +228,11 @@ function SetupSettings() {
//
function checkControlPortStoredSettings(storedSettings) {
if (storedSettings.control_port != undefined) {
let control_port = storedSettings.control_port;
} else {
if (storedSettings.control_port == undefined) {
let new_control_port = "7657";
storedSettings.control_port = new_control_port;
} else {
let control_port = storedSettings.control_port;
}
console.log("Initialising Control Port", storedSettings.control_port);
setupProxy();
@@ -247,11 +247,11 @@ function SetupSettings() {
//
function checkHistoryStoredSettings(storedSettings) {
if (storedSettings.disable_history != undefined) {
disable_history = storedSettings.disable_history;
} else {
if (storedSettings.disable_history == undefined) {
disable_history = false;
storedSettings.disable_history = disable_history;
} else {
disable_history = storedSettings.disable_history;
}
console.log(
"Initialising Disabled History",
@@ -337,14 +337,14 @@ function updateFromStorage() {
console.log("updating settings from storage");
var gettingInfo = browser.runtime.getPlatformInfo();
gettingInfo.then(got => {
if (got.os != "android") {
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
if (got.os == "android") {
chrome.storage.local.get(function() {
SetupSettings();
update();
setupProxy();
});
} else {
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
chrome.storage.local.get(function() {
SetupSettings();
update();

View File

@@ -87,7 +87,7 @@ var contextScrub = async function(requestDetails) {
}
};
var contextSetup = async function(requestDetails) {
var contextSetup = function(requestDetails) {
function onContextError() {
console.log("Context launcher error");
}
@@ -421,5 +421,8 @@ browser.webRequest.onBeforeRequest.addListener(
browser.webRequest.onBeforeSendHeaders.addListener(
contextScrub,
{ urls: ["<all_urls>"] },
["blocking", "requestHeaders"]
[
"blocking",
"requestHeaders"
]
);