Reputation: 51
I have a question. I need to execute my extension every some period of time, but I can`t, because my script is executed only when popap is open. I would want it started to work after opening chrome browser.
It`s my manifest.json:
"name": "MyExt",
"version": "1.0",
"description": " 'It`s my extension",
"background": {
"scripts": ["js/core.js"],
"persistent": true
},
"icons": {
"128" : "icon.png"
},
"browser_action": {
"default_icon": "ext.png",
"default_title": "MyExt",
"default_popup": "index.html"
},
Upvotes: 1
Views: 2794
Reputation: 83
In short, no, you cannot execute the code in time intervals. What you can do is register an eventListener
in background.js (or whatever you decide to name it) and execute the code you put in there when the event happens(extension is installed, there is an available update either for your extension or for Chrome etc.).
On the link below you can see all the available event listeners: https://developer.chrome.com/extensions/runtime#events
Upvotes: 0