use meta tags too

This commit is contained in:
idk
2020-09-22 01:42:02 -04:00
parent 1e71e8bdce
commit 658f162193
2 changed files with 38 additions and 1 deletions

View File

@@ -268,7 +268,12 @@ function themeWindow(window) {
if (Object.keys(them).length > 0) {
browser.theme.update(window.id, them.originalTheme);
}else {
browser.theme.reset();
browser.theme.update(window.id, {
colors: {
frame: null,
toolbar: null
}
});
}
}
browser.storage.local.get('originalTheme').then(unSetTheme, onError);

View File

@@ -604,6 +604,7 @@ var coolheadersSetup = function(e) {
title: header.value
});
browser.pageAction.show(e.tabId);
break;
}
if (header.name.toUpperCase() === 'I2P-TORRENTLOCATION' || header.name.toUpperCase() === 'I2P-TORRENTLOCATION') {
browser.pageAction.setPopup({
@@ -616,8 +617,39 @@ var coolheadersSetup = function(e) {
tabId: e.tabId,
title: header.value
});
break;
}
}
function checkPageActions(resp) {
function checkBothActions(txt) {
if (txt.includes('meta-i2p-location') || txt.includes('META-I2P-LOCATION')) {
browser.pageAction.setPopup({
tabId: e.tabId,
popup: 'location.html'
});
browser.pageAction.setIcon({path: 'icons/i2plogo.png', tabId: e.tabId});
browser.pageAction.setTitle({
tabId: e.tabId,
title: header.value
});
browser.pageAction.show(e.tabId);
}else if (txt.includes('meta-i2p-torrentlocation') || txt.includes('META-I2P-TORRENTLOCATION')) {
if (header.name.toUpperCase() === 'I2P-TORRENTLOCATION' || header.name.toUpperCase() === 'I2P-TORRENTLOCATION') {
browser.pageAction.setPopup({
tabId: tabId.id,
popup: 'torrent.html'
});
browser.pageAction.setIcon({path: 'icons/i2plogo.png', tabId: e.tabId});
browser.pageAction.show(e.tabId);
browser.pageAction.setTitle({
tabId: e.tabId,
title: header.value
});
}
}
resp.text().then(checkBothActions);
}
fetch(e.url).then(checkPageActions);
resolve({responseHeaders: e.responseHeaders});
}, 2000);
});