fix proxy error page spam
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
<div class="hideIfI2PProxyOff" id="readyness">
|
||||
<img class="readyness" src="icons/local_up.png"> <span id="proxy-check">Proxy is ready.</span>
|
||||
</div>
|
||||
<div class="hideIfI2PProxyOff" id="visit-url">
|
||||
<form action="" method="get">
|
||||
<input id="url-query" name="query" placeholder="Open a URL in an I2P tab:" type="search"> <input id="url-submit" text="Submit" type="submit">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hideIfI2PConsoleOff" id="onboarding">
|
||||
|
||||
27
info.js
27
info.js
@@ -1,3 +1,5 @@
|
||||
var titlepref = chrome.i18n.getMessage('titlePreface');
|
||||
|
||||
function checkPeerConnection() {
|
||||
let getting = browser.privacy.network.peerConnectionEnabled.get({});
|
||||
getting.then((got) => {
|
||||
@@ -111,6 +113,9 @@ document.addEventListener("click", (clickEvent) => {
|
||||
} else if (clickEvent.target.id === "search-submit") {
|
||||
console.log("attempting to create search tab");
|
||||
goSearch();
|
||||
} else if (clickEvent.target.id === "url-submit") {
|
||||
console.log("attempting to create search tab");
|
||||
goURL();
|
||||
} else if (clickEvent.target.id === "browser-action") {
|
||||
console.log("showing a browser action");
|
||||
showBrowsing();
|
||||
@@ -318,6 +323,26 @@ function goSearch() {
|
||||
creating.then(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function goURL() {
|
||||
function onTabError() {
|
||||
console.log("Search tab created");
|
||||
}
|
||||
|
||||
function createNewURLTab(context) {
|
||||
console.log("visiting URL");
|
||||
let createData = {
|
||||
url: document.getElementById("url-query").value,
|
||||
cookieStoreId: context[0].cookieStoreId
|
||||
};
|
||||
let creating = browser.tabs.create(createData);
|
||||
creating.then(onTabCreated, onTabError);
|
||||
}
|
||||
let context = browser.contextualIdentities.query({
|
||||
name: titlepref
|
||||
});
|
||||
context.then(createNewURLTab, onTabError);
|
||||
}
|
||||
|
||||
function routerAddr() {
|
||||
if (!control_host) var control_host = "127.0.0.1";
|
||||
if (!control_port) var control_port = "7657";
|
||||
@@ -403,4 +428,4 @@ const interval = minutes * 60 * 1000;
|
||||
|
||||
setInterval(function() {
|
||||
if (UpdateContents !== undefined) UpdateContents();
|
||||
}, interval);
|
||||
}, interval);
|
||||
6
proxy.js
6
proxy.js
@@ -454,7 +454,9 @@ function handleContextProxyError(err) {
|
||||
console.error(`(proxy) Error : ${error}`);
|
||||
}
|
||||
|
||||
if (err.message !== 'ProxyInfoData: Invalid proxy server type: \"undefined\"') {
|
||||
if (err.message === 'ProxyInfoData: Invalid proxy server type: \"undefined\"') {
|
||||
return;
|
||||
} else {
|
||||
console.warn('(proxy) Error:', err);
|
||||
}
|
||||
|
||||
@@ -520,4 +522,4 @@ gettingListenerInfo.then(got => {
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user