Skip to content

Instantly share code, notes, and snippets.

@linmic
Last active February 3, 2023 15:28
Show Gist options
  • Save linmic/4794bea9edafa3cede59 to your computer and use it in GitHub Desktop.
Save linmic/4794bea9edafa3cede59 to your computer and use it in GitHub Desktop.
var opt = {
type: 'list',
title: 'keep burning',
message: 'Primary message to display',
priority: 1,
items: [{ title: '', message: ''}],
iconUrl:'../images/icon.png'
};
chrome.notifications.create('notify1', opt, function(id) { console.log("Last error:", chrome.runtime.lastError); });
//use console.log("Last error:", chrome.runtime.lastError); for debug
var opt = {
type: 'list',
title: 'keep burning',
message: 'Primary message to display',
priority: 1,
items: [{ title: '', message: ''}],
iconUrl:'../images/icon.png'
};
chrome.notifications.create('id', opt, function(id) {});
@Tyrowo
Copy link

Tyrowo commented Aug 8, 2021

did this final version work for you? Using your code I'm getting an error -
Unchecked runtime.lastError: List items provided for notification type != list

@OhmV-IR
Copy link

OhmV-IR commented Feb 3, 2023

If think you made a basic notification which does not need the items line of the final version so just remove that or change your notification type to a list and you should be good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment