I recently started exploring Chrome Extensions and looked at sample code to understand how all the different parts fit together. I see that the logic of extensions is processed mainly on the background pages, but looking at the following code example, I noticed something peculiar.
{ "name": "Notification Demo", "version": "1", "description": "Shows off desktop notifications, which are \"toast\" windows that pop up on the desktop.", "icons": {"16": "16.png", "48": "48.png", "128": "128.png"}, "permissions": ["tabs", "notifications"], "options_page": "options.html", "background": { "scripts": ["background.js"] }, "content_security_policy": "script-src 'self'; img-src 'self'" }
There is no background_page, but a background instead. I know that in βpermissionsβ there is a parameter that allows chrome to work in the background, even if it is not open, but it seems to be something else. It seems like you can use a background script instead of a background, but when I try to find information about it, I come up with nothing. Has anyone seen or used this before, and can you give a brief description of what would be the benefit of using a script background against the page background?
source share