您可以为正常的本地主机测试启用 chrome.storage 和 chrome.fileSystem 吗?

Can you enable chrome.storage and chrome.fileSystem for normal localhost testing?

我正在开发一个 Chrome 应用程序,每次我进行更改时使用建议的手动刷新应用程序的工作流程令人恼火。我想使用普通的本地主机服务器工作流程,但我需要访问 chrome.storage 和 chrome.fileSystem。有没有办法在扩展沙箱之外启用这些功能?

Is there a way to enable these features outside of the extensions sandbox?

没有

反正不直接。

您可以可以想象创建一个代理extension/app,它将使用"externally_connectable" messages.

为您执行特权命令

但这对您的开发没有帮助 - 您需要以复杂的方式代理所有 API 调用。对于需要用户手势的 API,它也可能会失败。


您应该改为考虑通过一些外部命令以编程方式重新加载您的应用程序。这是可能的 - 使用 management API and a native "proxy" module using WebSockets or Native Messaging 的扩展可以让您通过系统中的任何事件刷新您的应用程序。

这是 GhostText 所采用的方法。