Using the new chrome.notifications
API, I am unable to get notifications from my extension to appear. Even the most basic notification fails to appear for me, but I get no errors and the callback function is properly executed.
manifest.json
{
"name": "notify",
"version": "0.0.0",
"manifest_version": 2,
"permissions": [
"notifications"
],
"background": {
"scripts": ["main.js"]
}
}
main.js
window.addEventListener('load', function() {
var opt = {
type: 'list',
title: 'Primary Title',
message: 'Primary message to display',
priority: 1,
items: [{ title: 'Item1', message: 'This is item 1.'},
{ title: 'Item2', message: 'This is item 2.'},
{ title: 'Item3', message: 'This is item 3.'}]
};
chrome.notifications.create('notify1', opt, function() { console.log('created!'); });
});
When I inspect the background page, I can see "created!" in the console, but I don't ever get a notification on the desktop. I have tried a bunch of different priority values to no avail. What am I doing wrong?