I'm working on a Chrome/Firefox extension which will be using the file API to store files locally. I'm trying to get an example up and running but I'm running into issues which seem to center around Chrome. Can anyone explain why this jsFiddle works fine, but the exact same code, when run from a local file, doesn't work. Please note that it works fine in Firefox, just not in Chrome. Any ideas?
问问题
829 次
3 回答
1
Chrome 具有异常严格的网络安全性;很多东西,比如 Ajax,在本地运行时都不起作用。这是其中之一。您可以通过使用本地网络服务器(如 @ephemient 建议的那样)来解决此问题,或者您可以在不安全模式下运行 Chrome 进行测试:
chrome.exe --disable-web-security
于 2012-03-16T23:04:16.520 回答
0
如果您使用的是铬。使用标志 --allow-file-access-from-files 从命令行启动 chrome chrome 不支持在没有此标志的情况下访问本地文件。
于 2012-06-14T10:33:58.213 回答