ContentiousMaximus
ContentiousMaximus

Reputation: 1304

Icon not showing up in Chrome extension Desktop Notification

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).

Upvotes: 2

Views: 2977

Answers (3)

user2505464
user2505464

Reputation:

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

Upvotes: 1

phareim
phareim

Reputation: 261

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

Upvotes: 1

user1796666
user1796666

Reputation:

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

Upvotes: 1

Related Questions