2

I'm building a Chrome extension that features Desktop Notifications. The following is the code I use:

var notification = webkitNotifications.createNotification(
  '48.png',  
  'Hello!',  
  'Lorem ipsum...'  
);

48.png is in the extension folder AND in the array of web_accessible_resources in the manifest.json. But the icon does not show up.

Can you help me? I'm using the latest Chrome version (Apple version, 22.0.1229.94).

ContentiousMaximus
  • 1,284
  • 3
  • 14
  • 24

3 Answers3

1

Perhaps you should try this:

var notification = webkitNotifications.createNotification(
  chrome.extension.getURL('48.png'),  
  'Hello!',  
  'Lorem ipsum...'  
);

use chrome.extension.getURL to get the extension path to your resources

Kirill Ivlev
  • 12,310
  • 5
  • 27
  • 31
1

Could the problem be web accessability-issues?

Try to whitelist your image in web accessible resources in your manifest-file. Rob W has provided a more thorough answer here:

Insert an image in chrome extension

Community
  • 1
  • 1
phareim
  • 261
  • 5
  • 9
1

The images in desktop notifications don't work in OS X. Windows and ChromeOS only.