Can't use cordova-plugin-file in Chrome : SecurityError when calling window.resolveLocalFileSystemURL

女生的网名这么多〃 提交于 2019-12-10 13:24:11

问题


I use latest cordova with browser platform (I do know it is some quite experimental).

I need to read and write in the cordova.file.dataDirectory directory. filePluginIsReady event is correctly fired in Chrome, and I put my read/write action in its callback.

I use cordova-plugin-file (latest), working great with Firefox and Internet Explorer 11, but with Google Chrome, calling window.resolveLocalFileSystemURL always raise this FileError :

code: 2 message: "It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources." name: "SecurityError"

I carefully read cordova-plugin-file README and the quircks about browser and chrome (large quota is granted, filesystem is initialized).

Adding --allow-file-access option to chrome launcher did not help to access filesystem:file:///persistent/.

With the specific code for Chrome in cordova-plugin-file, I was hoping it would work flawlessly. Any clue ?

来源:https://stackoverflow.com/questions/34925292/cant-use-cordova-plugin-file-in-chrome-securityerror-when-calling-window-reso

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!