Created
May 10, 2017 19:39
-
-
Save groovecoder/db52cf7aea927124ba5fc571fdb33afd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| webExtension.startup().then(api => { | |
| api.browser.runtime.onMessage.addListener((message, sender, sendReply) => { | |
| if ("method" in message && methods.indexOf(message.method) !== -1) { | |
| sendReply(this[message.method](message)); | |
| } | |
| }); | |
| console.log("webExtension.startup.then(), reason: ", reason); | |
| // Send "upgrade" message to WebExtension runtime | |
| if (reason === "upgrade") { | |
| console.log("sending upgrade message"); | |
| api.browser.runtime.sendMessage("upgrade").then(reply => { | |
| console.log(reply); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment