fix up some flow issues, should be OK this way
This commit is contained in:
@@ -178,12 +178,14 @@ function themeWindow(window) {
|
||||
}
|
||||
});
|
||||
}
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabInfo[0].id,
|
||||
popup: 'security.html'
|
||||
});
|
||||
//console.log("(background) tabinfo", tabInfo[0].id)
|
||||
browser.pageAction.show(tabInfo[0].id);
|
||||
if (tabinfo.url.startsWith("https://")){
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabInfo[0].id,
|
||||
popup: 'security.html'
|
||||
});
|
||||
//console.log("(background) tabinfo", tabInfo[0].id)
|
||||
browser.pageAction.show(tabInfo[0].id);
|
||||
}
|
||||
} else if (context.name == routerpref) {
|
||||
console.log('Active in Router Console window');
|
||||
if (window.incognito) {
|
||||
|
30
scrub.js
30
scrub.js
@@ -625,6 +625,20 @@ var coolheadersSetup = function(e) {
|
||||
});
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (header.name.toUpperCase() === 'I2P-TORRENTLOCATION' || header.name.toUpperCase() === 'X-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
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
resolve({responseHeaders: e.responseHeaders});
|
||||
@@ -651,6 +665,22 @@ function getClearTab(tobj) {
|
||||
}
|
||||
});
|
||||
console.log("(pageaction)", tab.id, tab.url)
|
||||
} else {
|
||||
browser.tabs.sendMessage( tab.id, {'req':'i2p-torrentlocation'}).then( response => {
|
||||
if (response.content.toUpperCase() != "NO-ALT-LOCATION"){
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: 'torrent.html'
|
||||
});
|
||||
browser.pageAction.setIcon({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)
|
||||
}
|
||||
}
|
||||
browser.tabs.get(tobj.tabId).then(getTabURL, onError)
|
||||
|
20
torrent.js
20
torrent.js
@@ -0,0 +1,20 @@
|
||||
|
||||
function gotCurrent(tab) {
|
||||
function gotTitle(title) {
|
||||
let addr = title;
|
||||
document.getElementById('TypeInfo').innerHTML = '<div class=\"AddressInfo\"><a href=\"' + addr + '\">' + addr + '</a></div>';
|
||||
}
|
||||
console.log(tab);
|
||||
var gettingTitle = browser.pageAction.getTitle({
|
||||
tabId: tab[0].id
|
||||
});
|
||||
gettingTitle.then(gotTitle);
|
||||
|
||||
}
|
||||
|
||||
function tabError(error) {
|
||||
console.log(`Error : ${error}`);
|
||||
}
|
||||
|
||||
const gettingCurrent = browser.tabs.query({ active: true });
|
||||
gettingCurrent.then(gotCurrent, tabError);
|
||||
|
Reference in New Issue
Block a user