How do you display a filesystem URL in a Chrome app webview?

て烟熏妆下的殇ゞ 提交于 2019-12-03 20:06:14

It looks like the webview tag does not support filesystem URIs - Chromium Issue 321628. Bummer.

You could try reading the file to a data URL using a FileReader, then setting the webview's src attribute to the URL.

I'm getting around it by using a simple web server I created in NaCl which I've already got embedded in my app (data URLs are messing up my file encoding).

You could work around this by including the web server for chorme library within your application. There are examples on the site for how to include it in your own chrome app. It would require you to use extra permissions in your manifest, namely some chrome.sockets permissions.

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