Created
July 8, 2019 06:50
-
-
Save huchenme/17415a4521f5e6d524fd08da4c7afd32 to your computer and use it in GitHub Desktop.
medium background script v1
This file contains 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
chrome.runtime.onInstalled.addListener(() => { | |
console.log('onInstalled...'); | |
// create alarm after extension is installed / upgraded | |
chrome.alarms.create('refresh', { periodInMinutes: 3 }); | |
}); | |
chrome.alarms.onAlarm.addListener((alarm) => { | |
console.log(alarm.name); // refresh | |
helloWorld(); | |
}); | |
function helloWorld() { | |
console.log("Hello, world!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@atomauro
chrome
is available for Chrome and Firefox, where are you getting this error? If it is eslint you should ignore it. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onInstalled