Improve the proxy readiness indicator

This commit is contained in:
idk
2020-01-11 23:14:58 -05:00
parent 5c268f8b3d
commit 3b2112076b
8 changed files with 41 additions and 20 deletions

View File

@@ -15,6 +15,10 @@
"message": "Proxy is not ready",
"description": "Proxy failed status."
},
"proxySuccessStatus": {
"message": "Proxy is ready",
"description": "Proxy failed status."
},
"controlHeader": {
"message": "Control",
"description": "Headline for control panel."

View File

@@ -40,8 +40,14 @@ contentUpdateById("snark", "snark");
// Homepage Section
contentUpdateById("window-visit-webpage", "windowVisitWebPage");
contentUpdateById("webpage", "webpage");
contentUpdateById("webpage", "help");
contentUpdateById("window-visit-sources", "windowVisitSources");
contentUpdateById("sources", "sources");
contentUpdateById("window-visit-releases", "windowVisitReleases");
contentUpdateById("releases", "releases");
fetch('http://proxy.i2p')
.then((myJson) => {
console.log("FETCH RESULT", myJson)
contentUpdateById("proxy-check", "proxySuccessStatus")
});

View File

@@ -265,9 +265,6 @@ li {
text-align: left;
display: none
}
#proxy-check {
visibility: hidden
}
#info-content {
display: none
}

View File

@@ -21,10 +21,10 @@
<p id="beta">This is an experimental product.</p>
</div>
<div id="readyness">
<div id="consoleOn" class="hideIfI2PConsoleOff">
<!--<div id="consoleOn" class="hideIfI2PConsoleOff">
<img class="readyness" src="http://proxy.i2p/themes/console/images/local_up.png" alt="Proxy is not ready."/>
<span id="proxy-check">Proxy is ready.</span>
</div>
</div>-->
<!--<div id="proxyUnready" class="hideIfI2PProxyOn">The proxy is not ready yet.</div>-->
<div id="proxyReady" class="hideIfI2PProxyOff">
<img class="readyness" src="http://proxy.i2p/themes/console/images/local_up.png" alt="Proxy is not ready."/>

View File

@@ -30,7 +30,6 @@ function localHost(url) {
function extensionHost(url) {
var res = url.startsWith(browser.runtime.getURL(""));
console.log("Extension URL?", res, url, browser.runtime.getURL(""));
return res;
}

25
info.js
View File

@@ -1,12 +1,4 @@
function checkPeerConnection() {
function snowflake(snowflake) {
console.log("snowflake plugin found, leaving WebRTC alone", snowflake);
EnablePeerConnection();
}
var snowflakeInfo = browser.management.get(
"{b11bea1f-a888-4332-8d8a-cec2be7d24b9}" // string
);
snowflakeInfo.then(snowflake);
let getting = browser.privacy.network.peerConnectionEnabled.get({});
getting.then(got => {
let webrtc = got.value;
@@ -17,6 +9,23 @@ function checkPeerConnection() {
checkPeerConnection();
function checkSnowflake(){
try {
function snowflake(snowflake) {
console.log("snowflake plugin found, leaving WebRTC alone", snowflake);
EnablePeerConnection();
}
var snowflakeInfo = browser.management.get(
"{b11bea1f-a888-4332-8d8a-cec2be7d24b9}" // string
);
snowflakeInfo.then(snowflake);
}catch{
console.log("snowflake not found")
}
}
checkSnowflake()
function checkHistory() {
let getting = browser.storage.local.get("disable_history");
getting.then(got => {

View File

@@ -117,6 +117,14 @@ var handleContextProxyRequest = async function(requestDetails) {
console.log("(proxy)Tab error", error);
}
};
if (proxyHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
return proxy;
}
if (
requestDetails.cookieStoreId == "firefox-default" ||
requestDetails.cookieStoreId == "firefox-private"

View File

@@ -26,12 +26,10 @@
<p id="description">You are now able to use I2P in this browser.</p>
<p id="beta">It is experimental.</p>
</div>
<div id="readyness">
<img class="readyness" src="http://proxy.i2p/themes/console/images/local_up.png" alt="Proxy is not ready."/>
<div id="readyness" class="hideIfI2PProxyOff">
<img class="readyness" src="http://proxy.i2p/themes/console/images/local_up.png"/>
<span id="proxy-check">Proxy is ready.</span>
<img class="readyness" src="http://proxy.i2p/themes/console/images/local_up.png" alt="Proxy is not ready."/>
<span id="proxy-check">Proxy is ready.</span>
</div>
</div>
</div>
<div class="panel-section-separator"></div>
<div class="browser-info">