Fix of privacy leaks caused by non-page requests

This commit is contained in:
Samuel Crypto
2019-08-01 13:30:35 -04:00
parent 15d8f31b26
commit 1ae63bc489
2 changed files with 19 additions and 1 deletions
+16
View File
@@ -18,6 +18,22 @@ window.Utils = {
imageElement.addEventListener("error", errorListener);
imageElement.addEventListener("load", loadListener);
return imageElement;
},
// See comment in PR #313 - so far the (hacky) method being used to block proxies is to produce a sufficiently long random address
getBogusProxy() {
const bogusFailover = 1;
if(typeof window.Utils.pregeneratedString !== 'undefined')
{
return {type:"socks4", host:"w.${window.Utils.pregeneratedString}.coo", port:9999, username:"foo", failoverTimeout:bogusFailover};
}
else
{
const bogusLength = 8;
let array = new Uint8Array(bogusLength);
window.crypto.getRandomValues(array);
window.Utils.pregeneratedString = array.toString('hex');
}
}
};