Create icon for each indicating state in the toolbar(HTTPS, Bittorrent, HTTPS+Bittorrent, X-I2P-Location) with our own lock icons for .i2p sites, https .i2p sites

This commit is contained in:
idk
2021-04-25 16:05:07 -04:00
parent 5393d7f26f
commit 02bc927262
8 changed files with 56 additions and 17 deletions

View File

@@ -214,17 +214,7 @@ function themeWindow(window) {
function logTabs(tabInfo) {
function onContextGotTheme(context) {
if (context.name == titlepref) {
browserTheme();
if (tabInfo[0].url.startsWith("https://")) {
browser.pageAction.setPopup({
tabId: tabInfo[0].id,
popup: "security.html",
});
browser.pageAction.setIcon({
path: "icons/toopies.png",
tabId: tabInfo[0].id,
});
//console.log("(background) tabinfo", tabInfo[0].id)
browserTheme();
browser.pageAction.show(tabInfo[0].id);
} else {
//browser.pageAction.hide(tabInfo[0].id);
@@ -382,6 +372,7 @@ function handleUpdated(updateInfo) {
function maybeSet(them) {
console.log("original theme found:", them, Object.keys(them).length);
try {
if (updateInfo.theme.colors != null) {
console.log(
"testing theme",
updateInfo.theme.colors.toolbar,
@@ -412,6 +403,7 @@ function handleUpdated(updateInfo) {
.then(onSet, onError);
//}
}
}
} catch (e) {
console.log("theme storage error", e);
}

BIN
icons/infotoopie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
icons/infotoopiebt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
icons/infotoopies.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
icons/infotoopiesbt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -677,10 +677,17 @@ var coolheadersSetup = function (e) {
tabId: e.tabId,
popup: "torrent.html",
});
browser.pageAction.setIcon({
path: "icons/i2plogo.png",
tabId: e.tabId,
});
if (tab.url.startsWith("https")){
browser.pageAction.setIcon({
path: "icons/infotoopiesbt.png",
tabId: e.tabId,
});
}else{
browser.pageAction.setIcon({
path: "icons/infotoopiebpt.png",
tabId: e.tabId,
});
}
browser.pageAction.setTitle({
tabId: e.tabId,
title: header.value,
@@ -698,6 +705,18 @@ var coolheadersSetup = function (e) {
function getTabURL(tab) {
if (tab.url.startsWith("https")) {
console.log(tab.url)
if (tab.url.endsWith(".i2p/")){
browser.pageAction.setPopup({
tabId: tab.id,
popup: "security.html",
});
browser.pageAction.setIcon({
path: "icons/infotoopies.png",
tabId: tab.id,
});
//console.log("(background) tabinfo", tabInfo[0].id)
}
try {
browser.tabs
.sendMessage(tab.id, { req: "i2p-location" })
@@ -710,7 +729,35 @@ function getTabURL(tab) {
popup: "location.html",
});
browser.pageAction.setIcon({
path: "icons/toopies.png",
path: "icons/i2plogo.png",
tabId: tab.id,
});
browser.pageAction.setTitle({
tabId: tab.id,
title: response.content,
});
browser.pageAction.show(tab.id);
}
}
});
console.log("(pageaction)", tab.id, tab.url);
} catch (e) {
console.log("(pageaction)", e);
}
try {
browser.tabs
.sendMessage(tab.id, { req: "i2p-torrentlocation" })
.then((response) => {
if (response != undefined) {
console.log("(scrub) i2p-location response object", response);
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
browser.pageAction.setPopup({
tabId: tab.id,
popup: "torrent.html",
});
browser.pageAction.setIcon({
path: "icons/infotoopiesbt.png",
tabId: tab.id,
});
browser.pageAction.setTitle({
@@ -738,7 +785,7 @@ function getTabURL(tab) {
popup: "torrent.html",
});
browser.pageAction.setIcon({
path: "icons/i2plogo.png",
path: "icons/infotoopiebt.png",
tabId: tab.id,
});
browser.pageAction.setTitle({