always also check localhost to see if it matches routerconsole too

This commit is contained in:
idk
2020-01-18 04:06:17 -05:00
parent 38d1170d87
commit 21d44755c3
3 changed files with 16 additions and 2 deletions

View File

@@ -40,6 +40,13 @@ function routerHost(url) {
//console.log("(hostcheck) router console found on configured ports");
return pathcheck(path);
}
if (hostname === "localhost" + ":" + control_port) {
//console.log("(hostcheck) router console found on configured ports");
return pathcheck(path);
}
if (hostname === "127.0.0.1" + ":" + control_port) {
return pathcheck(path);
}
return false;
}

View File

@@ -100,6 +100,13 @@ function routerHost(url) {
//console.log("(hostcheck) router console found on configured ports");
return pathcheck(path);
}
if (hostname === "localhost" + ":" + control_port) {
//console.log("(hostcheck) router console found on configured ports");
return pathcheck(path);
}
if (hostname === "127.0.0.1" + ":" + control_port) {
return pathcheck(path);
}
return false;
}

View File

@@ -47,7 +47,7 @@ function authenticate(
password = "transmission",
control_host = "127.0.0.1",
control_port = "7657",
control_path = "jsonrpc"
control_path = "transmission/rpc"
) {
let store = browser.storage.local.get("rpc_pass");
if (store != undefined) {
@@ -71,7 +71,7 @@ async function GetToken(
password,
control_host = "127.0.0.1",
control_port = "7657",
control_path = "jsonrpc"
control_path = "transmission/rpc"
) {
let me = authenticate(password);
return await me.then(gettoken);