Web Views power web apps on native devices.
The Web View is automatically provided for apps integrated with Capacitor.
Ionic apps are built using web technologies and are rendered using Web Views, which are a full screen and full-powered web browser.
http:// protocol with an optimized HTTP server that runs on the local device.
Capacitor and Cordova apps are hosted on a local HTTP server and are served with the
http:// protocol. Some plugins, however, attempt to access device files via the
file:// protocol. To avoid difficulties between
file://, paths to device files must be rewritten to use the local HTTP server. For example,
file:///path/to/device/file must be rewritten as
http://<host>:<port>/<prefix>/path/to/device/file before being rendered in the app.
For Capacitor apps, convert file URIs like so:
For Cordova apps, the Ionic Web View plugin provides a utility function for converting File URIs:
window.Ionic.WebView.convertFileSrc(). There is also a corresponding Ionic Native plugin: