Try and bail out of all proxy-setting in the Wire Web App

This commit is contained in:
idk
2020-12-09 17:09:54 -05:00
parent 7b2216a12f
commit 9cd6ce888e
3 changed files with 38 additions and 35 deletions

View File

@@ -110,8 +110,6 @@ var handlerSetup = function(requestDetails) {
return requestDetails;
};
browser.webRequest.onBeforeRequest.addListener(
handlerSetup,
{ urls: ['<all_urls>'] },
['blocking']
);
browser.webRequest.onBeforeRequest.addListener(handlerSetup, {
urls: ['<all_urls>'],
});

View File

@@ -155,7 +155,6 @@ var handleContextProxyRequest = async function(requestDetails) {
};
var tabGet = async function(tabId) {
try {
console.log('(proxy)Tab ID from Request', tabId);
let tabInfo = await browser.tabs.get(tabId);
return tabInfo;
} catch (error) {
@@ -185,6 +184,9 @@ var handleContextProxyRequest = async function(requestDetails) {
return browser.proxy.settings.get({});
}
if (requestDetails.tabId > 0) {
if (requestDetails.url.includes('MuWire')) {
return;
}
if (proxyHost(requestDetails.url)) {
proxy = {
type: getScheme(),

View File

@@ -593,7 +593,6 @@ var contextSetup = function(requestDetails) {
var tab = tabGet(requestDetails.tabId);
tab.then(isolate);
function isolate(oldtab) {
console.log('(scrub)tab discovered:', oldtab);
if (oldtab.cookieStoreId == 'firefox-default') {
if (i2pHost(requestDetails.url)) {
var thn = i2pHostName(requestDetails.url);
@@ -825,20 +824,22 @@ function getTabURL(tab) {
browser.tabs
.sendMessage(tab.id, { req: "i2p-location" })
.then((response) => {
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
browser.pageAction.setPopup({
tabId: tab.id,
popup: "location.html",
});
browser.pageAction.setIcon({
path: "icons/i2plogo.png",
tabId: tab.id,
});
browser.pageAction.setTitle({
tabId: tab.id,
title: response.content,
});
browser.pageAction.show(tab.id);
if (response != undefined) {
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
browser.pageAction.setPopup({
tabId: tab.id,
popup: "location.html",
});
browser.pageAction.setIcon({
path: "icons/i2plogo.png",
tabId: tab.id,
});
browser.pageAction.setTitle({
tabId: tab.id,
title: response.content,
});
browser.pageAction.show(tab.id);
}
}
});
console.log("(pageaction)", tab.id, tab.url);
@@ -850,20 +851,22 @@ function getTabURL(tab) {
browser.tabs
.sendMessage(tab.id, { req: "i2p-torrentlocation" })
.then((response) => {
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
browser.pageAction.setPopup({
tabId: tab.id,
popup: "torrent.html",
});
browser.pageAction.setIcon({
path: "icons/i2plogo.png",
tabId: tab.id,
});
browser.pageAction.setTitle({
tabId: tab.id,
title: response.content,
});
browser.pageAction.show(tab.id);
if (response != undefined) {
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
browser.pageAction.setPopup({
tabId: tab.id,
popup: "torrent.html",
});
browser.pageAction.setIcon({
path: "icons/i2plogo.png",
tabId: tab.id,
});
browser.pageAction.setTitle({
tabId: tab.id,
title: response.content,
});
browser.pageAction.show(tab.id);
}
}
});
console.log("(pageaction)", tab.id, tab.url);