In order to get access to the Chrome extension APIs you'll need to setup and install a barebones extension with the correct permissions.
You'll need a manifest.json with something like below:
{
"name": "foo",
"short_name": "foo",
"version": "0.0.1",
"manifest_version": 2,
"description": "foo bar",
"browser_action": {
"default_popup": "index.html",
},
"permissions": ["notifications"],
}
As well as an empty index.html
. Once you load your unpacked extension in the chrome://extensions
page you'll be able to inspect the popup index.html
and test out the notifications api in the inspector console.
As @abraham mentioned below another option would be to use a background script. You can do this by adding this object to manifest.json
:
"background": {
"scripts": ["background.js"]
}
In order to open the dev tools for the background page you'll need to click the background page
link of your extension found in chrome://extensions
.