将webrequest api与事件页面一起使用

问题描述 投票:21回答:2

将webrequest api与事件页面一起使用时,会收到错误消息:

'webRequest'API不能与事件页面一起使用。

在网上看,我找到了这个话题:http://code.google.com/p/chromium/issues/detail?id=119613

我的问题:为什么我们不能(或怎么能)同时使用两者?

google-chrome-extension
2个回答
35
投票

对于那些不想使用新的Event Pages并且更愿意坚持使用Background Pages的人,请务必在清单文件的"persistent": true属性中设置background

"background": {
    "scripts": ["bootstrap.js"],
    "persistent": true
  },

17
投票

找到declarativeWebRequest API,这将是解决方案。

现在可在开发和测试版渠道中使用。

© www.soinside.com 2019 - 2024. All rights reserved.