make ping side-effect free
This commit is contained in:
parent
11a400d533
commit
ef5bc2c353
@ -96,7 +96,7 @@ namespace TalerNotify {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
chrome.runtime.sendMessage({type: "ping"}, (resp) => {
|
chrome.runtime.sendMessage({type: "get-tab-cookie"}, (resp) => {
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
console.log("extension not yet ready");
|
console.log("extension not yet ready");
|
||||||
window.setTimeout(init, 200);
|
window.setTimeout(init, 200);
|
||||||
|
@ -54,7 +54,7 @@ function makeHandlers(db: IDBDatabase,
|
|||||||
["dump-db"]: function(detail, sender) {
|
["dump-db"]: function(detail, sender) {
|
||||||
return exportDb(db);
|
return exportDb(db);
|
||||||
},
|
},
|
||||||
["ping"]: function(detail, sender) {
|
["get-tab-cookie"]: function(detail, sender) {
|
||||||
if (!sender || !sender.tab || !sender.tab.id) {
|
if (!sender || !sender.tab || !sender.tab.id) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
@ -63,6 +63,9 @@ function makeHandlers(db: IDBDatabase,
|
|||||||
delete paymentRequestCookies[id];
|
delete paymentRequestCookies[id];
|
||||||
return Promise.resolve(info);
|
return Promise.resolve(info);
|
||||||
},
|
},
|
||||||
|
["ping"]: function(detail, sender) {
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
["reset"]: function(detail, sender) {
|
["reset"]: function(detail, sender) {
|
||||||
if (db) {
|
if (db) {
|
||||||
let tx = db.transaction(Array.from(db.objectStoreNames), 'readwrite');
|
let tx = db.transaction(Array.from(db.objectStoreNames), 'readwrite');
|
||||||
|
Loading…
Reference in New Issue
Block a user