如何使用InAppBrowser打开本地文件,并在文件插件中最近更改URL方案 [英] How to open local file with InAppBrowser with recent changes to URL scheme in File plugin

查看:288
本文介绍了如何使用InAppBrowser打开本地文件,并在文件插件中最近更改URL方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从服务器获取raw HTMl作为JSON属性,然后使用文件插件在设备文件系统上创建一个新文件。

I'm getting raw HTMl as JSON property from the server, then I create a new file on device filesystem using File plugin.

文件插件返回绝对路径到文件,但在最近的更改后,文件插件现在以URL方案返回文件位置。

File plugin was returning absolute path to file, but after recent changes, File plugin now returns file location as URL scheme.

cdvfile://localhost/<filesystemType>/<path to file>

有一种方法可以获取文件的绝对路径,以便可以使用InAppBrowser打开,还有一些其他方法打开文件插件创建的文件与InAppBrowser?

Is there a way to get an absolute path to file so it can be opened with InAppBrowser, or is there some other way to open files created by File plugin with InAppBrowser?

推荐答案

只需使用 FileEntry.toURL () - 它可以在InAppBrowser

Just use FileEntry.toURL() - it could be opened within the InAppBrowser

这篇关于如何使用InAppBrowser打开本地文件,并在文件插件中最近更改URL方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆