fmt, string changes
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<div class='background'>
|
||||
<div class='content'>
|
||||
<div class="text-section-header">
|
||||
<img width="30px" height="30px" src="icons/i2plogo.png"/>
|
||||
<h1 id="text-section-header">I2P Browsing</h1>
|
||||
</div>
|
||||
|
||||
|
||||
7
host.js
7
host.js
@@ -2,8 +2,7 @@ function proxyHost(requestDetails) {
|
||||
if (requestDetails.tabId > 0) {
|
||||
return false;
|
||||
}
|
||||
console.warn('(host) requestDetails', requestDetails.tabId);
|
||||
console.warn('(host) requestDetails', requestDetails.url);
|
||||
|
||||
let hostname = '';
|
||||
if (requestDetails.url.indexOf('://') > -1) {
|
||||
hostname = requestDetails.url.split('/')[2];
|
||||
@@ -15,6 +14,8 @@ function proxyHost(requestDetails) {
|
||||
console.warn('(host) is proxy.i2p', hostname);
|
||||
return true;
|
||||
}
|
||||
console.warn('(host) requestDetails', requestDetails.tabId);
|
||||
console.warn('(host) requestDetails', requestDetails.url);
|
||||
if (
|
||||
hostname == 'c6lilt4cr5x7jifxridpkesf2zgfwqfchtp6laihr4pdqomq25iq.b32.i2p'
|
||||
) {
|
||||
@@ -198,4 +199,4 @@ function routerHost(url) {
|
||||
return pathcheck(path);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
21
proxy.js
21
proxy.js
@@ -122,6 +122,13 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
}
|
||||
try {
|
||||
var handleProxyRequest = function(context) {
|
||||
if (proxyHost(requestDetails)) {
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
}
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
@@ -192,13 +199,11 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
};
|
||||
} else {
|
||||
if (proxyHost(requestDetails)) {
|
||||
if (requestDetails.tabId < 0) {
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
}
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
} else {
|
||||
proxy = null;
|
||||
}
|
||||
@@ -537,4 +542,4 @@ gettingListenerInfo.then((got) => {
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
38
proxyinfo.js
38
proxyinfo.js
@@ -1,21 +1,23 @@
|
||||
fetch('http://proxy.i2p').then(
|
||||
(myJson) => {
|
||||
console.warn('(proxyinfo)', myJson);
|
||||
contentUpdateById('proxy-check', 'proxySuccessStatus');
|
||||
let readyness = document.querySelectorAll('.readyness');
|
||||
if (readyness !== null) {
|
||||
unhide(readyness);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
fetch('http://proxy.i2p').then(
|
||||
(myJson) => {
|
||||
console.warn('(proxyinfo)', myJson);
|
||||
contentUpdateById('proxy-check', 'proxySuccessStatus');
|
||||
let readyness = document.querySelectorAll('.readyness');
|
||||
if (readyness !== null) {
|
||||
unhide(readyness);
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.error("(proxyinfo)", error);
|
||||
contentUpdateById("proxy-check", "proxyFailedStatus");
|
||||
let readyness = document.querySelectorAll(".readyness");
|
||||
if (readyness !== null) {
|
||||
hide(readyness);
|
||||
}
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.error("(proxyinfo)", error);
|
||||
contentUpdateById("proxy-check", "proxyFailedStatus");
|
||||
let readyness = document.querySelectorAll(".readyness");
|
||||
if (readyness !== null) {
|
||||
hide(readyness);
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
}, false);
|
||||
|
||||
function hide(elements) {
|
||||
elements = elements.length ? elements : [elements];
|
||||
@@ -54,4 +56,4 @@ fetch("http://127.0.0.1:7657/jsonrpc/")
|
||||
.catch((error) => {
|
||||
var toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
hide(toopieLinks);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user