fix the search thing
This commit is contained in:
@@ -186,25 +186,28 @@ function themeWindow(window) {
|
||||
});
|
||||
}
|
||||
}
|
||||
function browserTheme() {
|
||||
console.log('Active in I2P window');
|
||||
if (window.incognito) {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: '#363A68',
|
||||
toolbar: '#363A68',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: '#363A68',
|
||||
toolbar: '#363A68',
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
function logTabs(tabInfo) {
|
||||
function onContextGotTheme(context) {
|
||||
if (context.name == titlepref) {
|
||||
console.log('Active in I2P window');
|
||||
if (window.incognito) {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: '#363A68',
|
||||
toolbar: '#363A68',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: '#363A68',
|
||||
toolbar: '#363A68',
|
||||
},
|
||||
});
|
||||
}
|
||||
browserTheme();
|
||||
if (tabInfo[0].url.startsWith('https://')) {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabInfo[0].id,
|
||||
|
18
host.js
18
host.js
@@ -48,18 +48,18 @@ function i2pHostName(url) {
|
||||
let hostname = '';
|
||||
console.log('(hosts)', url);
|
||||
if (url.includes('=')) {
|
||||
if (url.includes(".i2p")){
|
||||
lsit = url.split('=')
|
||||
if (url.includes('.i2p')) {
|
||||
lsit = url.split('=');
|
||||
for (let item in lsit) {
|
||||
var items = lsit[item].split(`\%`) //"\%")
|
||||
for (let p in items){
|
||||
if (items[p].includes(".i2p")){
|
||||
hostname = items[p].replace('3D', 1)
|
||||
var items = lsit[item].split(`\ % `); //"\%")
|
||||
for (let p in items) {
|
||||
if (items[p].includes('.i2p')) {
|
||||
hostname = items[p].replace('3D', 1);
|
||||
}
|
||||
break
|
||||
break;
|
||||
}
|
||||
if (hostname != ''){
|
||||
break
|
||||
if (hostname != '') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
34
privacy.js
34
privacy.js
@@ -327,36 +327,36 @@ function forgetBrowsingData(storedSettings) {
|
||||
}
|
||||
|
||||
function i2pHostName(url) {
|
||||
let hostname = '';
|
||||
console.log('(hosts)', url);
|
||||
if (url.includes('=')) {
|
||||
if (url.includes(".i2p")){
|
||||
lsit = url.split('=')
|
||||
let hostname = "";
|
||||
console.log("(hosts)", url);
|
||||
if (url.includes("=")) {
|
||||
if (url.includes(".i2p")) {
|
||||
lsit = url.split("=");
|
||||
for (let item in lsit) {
|
||||
var items = lsit[item].split(`\%`) //"\%")
|
||||
for (let p in items){
|
||||
if (items[p].includes(".i2p")){
|
||||
hostname = items[p].replace('3D', 1)
|
||||
var items = lsit[item].split(`\%`); //"\%")
|
||||
for (let p in items) {
|
||||
if (items[p].includes(".i2p")) {
|
||||
hostname = items[p].replace("3D", 1);
|
||||
}
|
||||
break
|
||||
break;
|
||||
}
|
||||
if (hostname != ''){
|
||||
break
|
||||
if (hostname != "") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (url.indexOf('://') > -1) {
|
||||
hostname = url.split('/')[2];
|
||||
} else if (url.indexOf("://") > -1) {
|
||||
hostname = url.split("/")[2];
|
||||
} else {
|
||||
hostname = url.split('/')[0];
|
||||
hostname = url.split("/")[0];
|
||||
}
|
||||
return hostname;
|
||||
}
|
||||
|
||||
function i2pHost(url) {
|
||||
let hostname = i2pHostName(url);
|
||||
if (hostname.endsWith(".i2p")){
|
||||
console.log("(hostname) i2p", hostname)
|
||||
if (hostname.endsWith(".i2p")) {
|
||||
console.log("(hostname) i2p", hostname);
|
||||
}
|
||||
return hostname.endsWith(".i2p");
|
||||
}
|
||||
|
5
scrub.js
5
scrub.js
@@ -622,9 +622,10 @@ var contextSetup = function(requestDetails) {
|
||||
if (requestDetails.url.includes('=' + thn)) {
|
||||
console.log('(scrub)checking search hostnames =' + thn);
|
||||
var tpt = requestDetails.url.split('=' + thn, 2);
|
||||
requestDetails.url = 'http://' + thn +"/"+ tpt[1].replace('%2F', '');
|
||||
requestDetails.url =
|
||||
'http://' + thn + '/' + tpt[1].replace('%2F', '');
|
||||
}
|
||||
console.log('(scrub) new hostname',requestDetails.url)
|
||||
console.log('(scrub) new hostname', requestDetails.url);
|
||||
var setcookie = browser.cookies.set({
|
||||
firstPartyDomain: i2pHostName(requestDetails.url),
|
||||
url: requestDetails.url,
|
||||
|
Reference in New Issue
Block a user