fix xhr redirect thing when a router console page is passed to firefox as an argument at startup

This commit is contained in:
idk
2020-09-21 00:20:59 -04:00
parent bc1ef95a16
commit cf7d137d00
2 changed files with 13 additions and 13 deletions

View File

@@ -111,13 +111,13 @@ function routerHost(url) {
if (hostname === control_host + ':' + control_port) {
return pathcheck(path);
}
if (hostname === control_host + ':' + "7662") {
if (hostname === control_host + ':' + '7662') {
return pathcheck(path);
}
if (hostname === 'localhost' + ':' + "7662") {
if (hostname === 'localhost' + ':' + '7662') {
return pathcheck(path);
}
if (hostname === '127.0.0.1' + ':' + "7662") {
if (hostname === '127.0.0.1' + ':' + '7662') {
return pathcheck(path);
}
if (hostname === 'localhost' + ':' + control_port) {

View File

@@ -205,10 +205,10 @@ var contextSetup = function(requestDetails) {
});
pins.then(closeOldTab, onError);
}
if (requestDetails.url.endsWith("xhr1.html")){
if (requestDetails.url.endsWith('xhr1.html')) {
hostname = url.split('/')[2];
let prefix = url.substr(0, url.indexOf('://') + 3);
requestDetails.url = prefix+hostname+"/home"
requestDetails.url = prefix + hostname + '/home';
}
var created = browser.tabs.create({
active: true,
@@ -251,10 +251,10 @@ var contextSetup = function(requestDetails) {
});
pins.then(closeOldTab, onError);
}
if (requestDetails.url.endsWith("xhr1.html")){
if (requestDetails.url.endsWith('xhr1.html')) {
hostname = url.split('/')[2];
let prefix = url.substr(0, url.indexOf('://') + 3);
requestDetails.url = prefix+hostname+"/i2ptunnelmgr/"
requestDetails.url = prefix + hostname + '/i2ptunnelmgr/';
}
var created = browser.tabs.create({
active: true,
@@ -297,10 +297,10 @@ var contextSetup = function(requestDetails) {
});
pins.then(closeOldTab, onError);
}
if (requestDetails.url.endsWith("xhr1.html")){
if (requestDetails.url.endsWith('xhr1.html')) {
hostname = url.split('/')[2];
let prefix = url.substr(0, url.indexOf('://') + 3);
requestDetails.url = prefix+hostname+"/i2psnark/"
requestDetails.url = prefix + hostname + '/i2psnark/';
}
var created = browser.tabs.create({
active: true,
@@ -343,10 +343,10 @@ var contextSetup = function(requestDetails) {
});
pins.then(closeOldTab, onError);
}
if (requestDetails.url.endsWith("xhr1.html")){
if (requestDetails.url.endsWith('xhr1.html')) {
hostname = url.split('/')[2];
let prefix = url.substr(0, url.indexOf('://') + 3);
requestDetails.url = prefix+hostname+"/muwire/"
requestDetails.url = prefix + hostname + '/muwire/';
}
var created = browser.tabs.create({
active: true,
@@ -389,10 +389,10 @@ var contextSetup = function(requestDetails) {
});
pins.then(closeOldTab, onError);
}
if (requestDetails.url.endsWith("xhr1.html")){
if (requestDetails.url.endsWith('xhr1.html')) {
hostname = url.split('/')[2];
let prefix = url.substr(0, url.indexOf('://') + 3);
requestDetails.url = prefix+hostname+"/webmail/"
requestDetails.url = prefix + hostname + '/webmail/';
}
var created = browser.tabs.create({
active: true,