Google Chrome通知无法显示

时间:2014-08-01 09:49:32

标签: javascript google-chrome-extension notifications

我希望通过Google Chrome扩展程序发送通知 的清单

{
  "name": "Test",
  "description": "Test",
  "version": "1.1",
  "background": {
    "scripts": ["background.js"]
  },
  "permissions": [
    "tabs", "http://*/*", "https://*/*",
    "notifications"
  ],
  "browser_action": {
      "default_title": "Test",
      "default_icon": "test_16x16.png"
  },
  "manifest_version": 2
}

background.js

chrome.browserAction.onClicked.addListener(function() {
chrome.notifications.create(
    'name-for-notification',{   
    type: 'basic', 
    iconUrl: 'image.jpeg', 
    title: "This is a notification", 
    message: "hello there!" 
    },

function() {} 

);
});]

为什么不起作用?

0 个答案:

没有答案