Fix up x-i2p-location
This commit is contained in:
@@ -11,6 +11,11 @@ function tabCheck(tabInfo) {
|
||||
document.getElementById('TypeInfo').appendChild('<div class=\"AddressInfo\"><a href=\"' + header + '\">' + header + '</a></div>');
|
||||
}
|
||||
}
|
||||
if response.headers.has('x-i2p-location') {
|
||||
for header in response.headers.get('x-i2p-location') {
|
||||
document.getElementById('TypeInfo').appendChild('<div class=\"AddressInfo\"><a href=\"' + header + '\">' + header + '</a></div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -343,9 +343,7 @@ function i2pHost(url) {
|
||||
|
||||
function onContextGotLog(contexts) {
|
||||
if (contexts != null) {
|
||||
for (let context of contexts) {
|
||||
console.log(context);
|
||||
}
|
||||
console.log(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
scrub.js
9
scrub.js
@@ -564,17 +564,17 @@ var contextSetup = function(requestDetails) {
|
||||
};
|
||||
|
||||
var coolheadersSetup = function(e) {
|
||||
var asyncSetCookie = new Promise((resolve, reject) => {
|
||||
var asyncSetPageAction = new Promise((resolve, reject) => {
|
||||
window.setTimeout(() => {
|
||||
for (header in e.responseHeaders) {
|
||||
if (header.name === 'i2p-location' || header.name === 'i2p-Location' || header.name === 'I2P-location' || header.name === 'I2P-Location' || header.name === 'I2p-Location' || header.name === 'I2p-location') {
|
||||
if (header.name.ToUpperCase() === 'I2P-LOCATION' || header.name.ToUpperCase() === 'X-I2P-LOCATION') {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabId.id,
|
||||
popup: 'location.html'
|
||||
});
|
||||
browser.pageAction.show(tabId.id);
|
||||
}
|
||||
if (header.name === 'i2p-TorrentLocation' || header.name === 'i2p-Torrentlocation' || header.name === 'i2p-torrentlocation' || header.name === 'I2P-torrentlocation' || header.name === 'I2P-TorrentLocation' || header.name === 'I2P-Torrentlocation' || header.name === 'I2p-TorrentLocation' || header.name === 'I2p-Torrentlocation' || header.name === 'I2p-torrentlocation') {
|
||||
if (header.name.ToUpperCase() === 'I2P-TORRENTLOCATION' || header.name.ToUpperCase() === 'I2P-TORRENTLOCATION') {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabId.id,
|
||||
popup: 'torrent.html'
|
||||
@@ -586,8 +586,7 @@ var coolheadersSetup = function(e) {
|
||||
resolve({responseHeaders: e.responseHeaders});
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
return asyncSetCookie;
|
||||
return asyncSetPageAction;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user