Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
cordova-plugin-ionic-webview
Advanced tools
A Web View plugin for Cordova, focused on providing the highest performance experience for Ionic apps (but can be used with any Cordova app).
This plugin defaults to using WKWebView on iOS and the latest evergreen webview on Android. Additionally, this plugin makes it easy to use HTML5 style routing that web developers expect for building single-page apps.
Note: This repo and its documentation are for cordova-plugin-ionic-webview
@ 2.x
, which uses the new features that may not work with all apps. See Requirements and Migrating to 2.x.
:book: Documentation: https://beta.ionicframework.com/docs/building/webview
:mega: Support/Questions? Please see our Support Page for general support questions. The issues on GitHub should be reserved for bug reports and feature requests.
:sparkling_heart: Want to contribute? Please see CONTRIBUTING.md.
This plugin has several configuration options that can be set in config.xml
. Important: some configuration options should be adjusted for production apps, especially WKPort
:
Preferences available for both iOS and Android platforms
<preference name="WKPort" value="8080" />
The default port the server will listen on. You should change this to a random port number!
Preferences only available for iOS platform
<preference name="UseScheme" value="true" />
Default value is false
.
On iOS 11 and newer it will use a WKURLSchemeHandler
that loads the app from ionic://
scheme instead of using the local web server and https://
scheme.
On iOS 10 and older will continue using the local web server even if the preference is set to true
.
<preference name="HostName" value="myHostName" />
Default value is app
.
If UseScheme
is set to yes, it will use the HostName
value as the host of the starting url.
Example ionic://app
This preference has been removed in 2.4.0 version of the plugin as it relied on a private API. Apps relying on this preference will not work as intended after the update. It will act as the previous default value, which was true.
<preference name="WKSuspendInBackground" value="true" />
Whether to try to keep the server running when the app is backgrounded. Note: the server will likely be suspended by the OS after a few minutes. In particular, long-lived background tasks are not allowed on iOS outside of select audio and geolocation tasks.
<preference name="WKBind" value="localhost" />
The hostname the server will bind to. There aren't a lot of other valid options, but some prefer binding to "127.0.0.1"
<preference name="WKInternalConnectionsOnly" value="true" />
Whether to restrict access to this server to the app itself. Previous versions of this plugin did not restrict access to the app itself. In 2.2.0 and above, the plugin now restricts access to only the app itself.
<preference name="KeyboardAppearanceDark" value="false" />
Whether to use a dark styled keyboard on iOS
cordova-ios
4+cordova-android
6.4+Remove and re-add the Web View plugin:
cordova plugin rm cordova-plugin-ionic-webview
cordova plugin add cordova-plugin-ionic-webview@latest
Apps are now served from HTTP on Android.
http://localhost:8080
.Replace any usages of window.Ionic.normalizeURL()
with window.Ionic.WebView.convertFileSrc()
.
For Ionic Angular projects, there is an Ionic Native wrapper:
npm install @ionic-native/ionic-webview@beta
FAQs
Ionic Web View Engine Plugin
The npm package cordova-plugin-ionic-webview receives a total of 14,686 weekly downloads. As such, cordova-plugin-ionic-webview popularity was classified as popular.
We found that cordova-plugin-ionic-webview demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 27 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.