diff --git a/handler.js b/handler.js index b1113b2..b0c6fc1 100644 --- a/handler.js +++ b/handler.js @@ -110,8 +110,6 @@ var handlerSetup = function(requestDetails) { return requestDetails; }; -browser.webRequest.onBeforeRequest.addListener( - handlerSetup, - { urls: [''] }, - ['blocking'] -); +browser.webRequest.onBeforeRequest.addListener(handlerSetup, { + urls: [''], +}); diff --git a/proxy.js b/proxy.js index 389cdca..b8e7571 100644 --- a/proxy.js +++ b/proxy.js @@ -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(), diff --git a/scrub.js b/scrub.js index 40267eb..2dce950 100644 --- a/scrub.js +++ b/scrub.js @@ -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);