I am trying to create a simple extension that runs a script without user intervention . The script will automatically generate notifications, and the user must do nothing but install the extension.
What my background.js looks like,
chrome.alarms.create("myAlarm", { periodInMinutes : 1 }); chrome.alarms.onAlarm.addListener(function(alarm) { if (alarm.name === "myAlarm") { alert("Tick..."); } });
So in this case the browser action button is not used. In any case, if I remove the bottom, the extension will not work ( alert with 'Tick' will NOT popup ).
"browser_action": { "default_icon": "icon.png"}
If I have just below, then there will still be an icon without an image (( Anyway alert with 'Tick' will popup )).
"browser_action": { }
Now I have this ( alert with 'Tick' will popup ),
{ "name": "myExt", "version": "1.0", "manifest_version": 2, "background": { "scripts": ["background.js"] }, "browser_action": { "default_icon": "icon.png" }, "permissions": [ "https://www.google.com/", "notifications", "alarms" ] }
All I need to do is in the background.js file. It will use chrome.alarms to create periodic notifications.
So, all I want to do is just run the script in the background, any idea on how to remove the browser icon in the menu bar?
javascript google-chrome google-chrome-extension
prime
source share