【问题标题】:Play chrome extension in background在后台播放 chrome 扩展
【发布时间】:2011-11-14 09:12:26
【问题描述】:

我正在制作一个警报 chrome 扩展,我想在指定时间之前发出通知,我不希望用户一直保持扩展窗口打开,我从here 阅读了有关背景的信息。

我像这样在 manifest.json 中添加 background_page 和后台权限

 {
    "name": "Alert extention",
    "version": "2.0",
    "description": "Personal alert.",
    "background_page": "Alert.html",
    "browser_action": {
        "default_icon": "img/clock.png",
    "popup": "Alert.html"
    },
    "permissions": [
        "notifications","background"
    ]
}

但扩展程序关闭时没有通知发生。我为扩展程序重新加载第一个通知,但其他人没有。

What should make ??? any suggestion??

【问题讨论】:

    标签: google-chrome background google-chrome-extension


    【解决方案1】:

    我通过将我想在后台工作的代码包装到这两行代码中来解决问题。

    chrome.extension.getViews().forEach(function(view){
          //my code go here!
    });
    

    【讨论】:

      猜你喜欢
      • 2013-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-28
      • 2012-06-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多