我有一个Chrome扩展,基本上功能类似于高级的“脱机模式”,在这里我保存了所请求的所有资源,并可以在稍后用户请求url缓存资源时提供这些资源。
我使用的是webRequest API,大多数情况下都在工作:
onBeforeRequest
侦听器中的请求重定向到其他http: requestsfilesystem:
协议访问我在Chrome中存储的文件(类似于文件系统:chrome-扩展名:/persistent/)但是,我无法使用filesystem:
协议将webRequest请求重定向到urls。当我尝试时,我会得到一个onErrorOccurred
事件(下面是错误)。
如何将chrome扩展名重定向到filesystem:chrome-extension://
url?,否则,如何将Chrome扩展名重定向到相同扩展名创建的本地文件?
下面是完整的error details对象,以防有帮助。
error: "net::ERR_ABORTED"
frameId: 0
fromCache: false
method: "GET"
parentFrameId: -1
requestId: "22557"
tabId: 6
timeStamp: 1386874360306.4211
type: "main_frame"
url: "http://<redacted, but correct.>"
发布于 2014-06-11 17:07:25
这应该对一些人有帮助。
return { redirectUrl: chrome.extension.getURL("/your/local/storage.jpg") }
https://stackoverflow.com/questions/20551909
复制相似问题