Set up a callback system for the browser link.
This should somewhat simulate asynchronous method calling.
This commit is contained in:
@@ -9,12 +9,5 @@ Listen for messages from the app.
|
||||
*/
|
||||
port.onMessage.addListener((response) => {
|
||||
console.log("Received: " + response);
|
||||
port.postMessage("pong");
|
||||
});
|
||||
|
||||
/*
|
||||
On a click on the browser action, send the app a message.
|
||||
*/
|
||||
browser.browserAction.onClicked.addListener(() => {
|
||||
console.log("Sending: ping");
|
||||
port.postMessage("ping");
|
||||
});
|
||||
Reference in New Issue
Block a user