correct promise resolution on scripts.js
This commit is contained in:
@@ -5,15 +5,12 @@ browser.runtime.onMessage.addListener((request) => {
|
||||
var tag = document.querySelector('meta[http-equiv="i2p-location"]');
|
||||
console.log(tag);
|
||||
if (tag) response = tag.content;
|
||||
return response;
|
||||
}
|
||||
|
||||
if (request.req === 'i2p-torrentlocation') {
|
||||
const metas = document.getElementsByTagName('meta');
|
||||
var tag = document.querySelector('meta[http-equiv="i2p-torrentlocation"]');
|
||||
console.log(tag);
|
||||
response = i2pTorrent(tag);
|
||||
return response;
|
||||
}
|
||||
return Promise.resolve({ content: response });
|
||||
});
|
||||
|
||||
2
scrub.js
2
scrub.js
@@ -821,6 +821,7 @@ function getTabURL(tab) {
|
||||
.sendMessage(tab.id, { req: "i2p-location" })
|
||||
.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,
|
||||
@@ -848,6 +849,7 @@ function getTabURL(tab) {
|
||||
.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,
|
||||
|
||||
Reference in New Issue
Block a user