{"id":13726339,"url":"https://github.com/ionic-team/cordova-plugin-ionic-webview","last_synced_at":"2025-04-11T06:20:47.069Z","repository":{"id":46176099,"uuid":"104773211","full_name":"ionic-team/cordova-plugin-ionic-webview","owner":"ionic-team","description":"Web View plugin for Cordova, specialized for Ionic apps.","archived":false,"fork":false,"pushed_at":"2024-08-12T14:11:37.000Z","size":616,"stargazers_count":494,"open_issues_count":170,"forks_count":397,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-04-11T04:04:03.217Z","etag":null,"topics":["cordova","cordova-android","cordova-ios","ionic","webview"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ionic-team.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-25T16:14:22.000Z","updated_at":"2025-04-04T04:14:39.000Z","dependencies_parsed_at":"2023-02-06T09:16:34.803Z","dependency_job_id":"c64d4a9d-5dd6-4190-98ee-ea38436b3ffb","html_url":"https://github.com/ionic-team/cordova-plugin-ionic-webview","commit_stats":{"total_commits":401,"total_committers":64,"mean_commits":6.265625,"dds":0.8179551122194514,"last_synced_commit":"e591d7c73bf0abe973b7a7eaaf8e95b50c0e5708"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionic-team%2Fcordova-plugin-ionic-webview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionic-team%2Fcordova-plugin-ionic-webview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionic-team%2Fcordova-plugin-ionic-webview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionic-team%2Fcordova-plugin-ionic-webview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ionic-team","download_url":"https://codeload.github.com/ionic-team/cordova-plugin-ionic-webview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248352309,"owners_count":21089418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cordova","cordova-android","cordova-ios","ionic","webview"],"created_at":"2024-08-03T01:02:59.954Z","updated_at":"2025-04-11T06:20:47.037Z","avatar_url":"https://github.com/ionic-team.png","language":"Objective-C","readme":"\u003c!--\n# license: Licensed to the Apache Software Foundation (ASF) under one\n#         or more contributor license agreements.  See the NOTICE file\n#         distributed with this work for additional information\n#         regarding copyright ownership.  The ASF licenses this file\n#         to you under the Apache License, Version 2.0 (the\n#         \"License\"); you may not use this file except in compliance\n#         with the License.  You may obtain a copy of the License at\n#\n#           http://www.apache.org/licenses/LICENSE-2.0\n#\n#         Unless required by applicable law or agreed to in writing,\n#         software distributed under the License is distributed on an\n#         \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n#         KIND, either express or implied.  See the License for the\n#         specific language governing permissions and limitations\n#         under the License.\n--\u003e\n\n\u003c!-- TODO: remove beta in README.md and CONTRIBUTING.md --\u003e\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\u0026identifier=104773211)](https://dependabot.com)\n[![npm](https://img.shields.io/npm/v/cordova-plugin-ionic-webview.svg)](https://www.npmjs.com/package/cordova-plugin-ionic-webview)\n\n# Ionic Web View for Cordova\n\nA Web View plugin for Cordova, focused on providing the highest performance experience for Ionic apps (but can be used with any Cordova app).\n\nThis plugin uses 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.\n\nNote: This repo and its documentation are for `cordova-plugin-ionic-webview` @ `5.x`, which uses the new features that may not work with all apps. See [Requirements](#plugin-requirements) and [Migrating to 5.x](#migrating-to-5x).\n\n2.x documentation can be found [here](https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/2.x/README.md).\n\n:book: **Documentation**: [https://beta.ionicframework.com/docs/building/webview][ionic-webview-docs]\n\n:mega: **Support/Questions?** Please see our [Support Page][ionic-support] for general support questions. The issues on GitHub should be reserved for bug reports and feature requests.\n\n:sparkling_heart: **Want to contribute?** Please see [CONTRIBUTING.md](https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/master/CONTRIBUTING.md).\n\n## Configuration\n\nThis plugin has several configuration options that can be set in `config.xml`.\n\n### Android and iOS Preferences\n\nPreferences available for both iOS and Android\n\n#### Hostname\n\n`\u003cpreference name=\"Hostname\" value=\"app\" /\u003e`\n\nDefault value is `localhost`.\n\nExample `ionic://app` on iOS, `http://app` on Android.\n\nIf you change it, you'll need to add a new `allow-navigation` entry in the `config.xml` for the configured url (i.e `\u003callow-navigation href=\"http://app/*\"/\u003e` if `Hostname` is set to `app`).\nThis is only needed for the Android url when using `http://`, `https://` or a custom scheme. All `ionic://` urls are whitelisted by the plugin.\n\n### Android Preferences\n\nPreferences only available Android platform\n\n#### Scheme\n\n```xml\n\u003cpreference name=\"Scheme\" value=\"https\" /\u003e\n```\n\nDefault value is `http`\n\nConfigures the Scheme the app uses to load the content.\n\n#### ResolveServiceWorkerRequests\n\n```xml\n\u003cpreference name=\"ResolveServiceWorkerRequests\" value=\"true\" /\u003e\n```\n\nDefault value is `false`\n\nEnable to resolve requests made by Service Workers through the local server.\n\n#### MixedContentMode\n\n```xml\n\u003cpreference name=\"MixedContentMode\" value=\"2\" /\u003e\n```\n\nConfigures the WebView's behavior when an origin attempts to load a resource from a different origin.\n\nDefault value is `0` (`MIXED_CONTENT_ALWAYS_ALLOW`), which allows loading resources from other origins.\n\nOther possible values are `1` (`MIXED_CONTENT_NEVER_ALLOW`) and `2` (`MIXED_CONTENT_COMPATIBILITY_MODE`)\n\n\n[Android documentation](https://developer.android.com/reference/android/webkit/WebSettings.html#setMixedContentMode(int))\n\n\n### iOS Preferences\n\nPreferences only available for iOS platform\n\n#### iosScheme\n\n```xml\n\u003cpreference name=\"iosScheme\" value=\"httpsionic\" /\u003e\n```\n\nDefault value is `ionic`\n\nConfigures the Scheme the app uses to load the content.\n\nValues like `http`, `https` or `file` are not valid and will use default value instead.\n\nIf you change it, you'll need to add a new `allow-navigation` entry in the `config.xml` for the configured scheme (i.e `\u003callow-navigation href=\"httpsionic://*\"/\u003e` if `iosScheme` is set to `httpsionic`).\n\n#### WKSuspendInBackground\n\n ```xml\n\u003cpreference name=\"WKSuspendInBackground\" value=\"false\" /\u003e\n```\n\nDefault value is `true` (suspend).\n\nSet to false to stop WKWebView suspending in background too eagerly.\n\n#### KeyboardAppearanceDark\n\n```xml\n\u003cpreference name=\"KeyboardAppearanceDark\" value=\"false\" /\u003e\n```\n\nWhether to use a dark styled keyboard on iOS\n\n#### ScrollEnabled\n\n```xml\n\u003cpreference name=\"ScrollEnabled\" value=\"true\" /\u003e\n```\n\nIonic apps work better if the WKWebView is not scrollable, so the scroll is disabled by default, but can be enabled with this preference. This only affects the main ScrollView of the WKWebView, so only affects the body, not other scrollable components.\n\n## Plugin Requirements\n\n* **Cordova CLI**: 7.1.0+\n* **iOS**: iOS 11+ and `cordova-ios` 4+\n* **Android**: Android 5+ and `cordova-android` 6.4+\n\n## Migrating to 5.x\n\n1. Remove and re-add the Web View plugin:\n\n    ```\n    cordova plugin rm cordova-plugin-ionic-webview\n    cordova plugin add cordova-plugin-ionic-webview@latest\n    ```\n\n1. If using `cordova-android` \u003c 9, make sure you have `\u003cpreference name=\"android-minSdkVersion\" value=\"21\" /\u003e` in the config.xml as this version of the plugin only supports Android 5+ (SDK 21+). If using `cordova-android` \u003e= 9 is not neccessary as `cordova-android` 9 only supports Android 5.1+ (SDK 22+)\n\n1. Since version 2, apps are served from HTTP on Android by default.\n\n    * The default origin for requests from the Android WebView is `http://localhost`. If `Hostname` and `Scheme` preferences are set, then origin will be `schemeValue://HostnameValue`.\n\n1. Since version 3, apps are served from `ionic://` scheme on iOS by default.\n\n    * The default origin for requests from the iOS WebView is `ionic://localhost`. If `Hostname` and `iosScheme` preferences are set, then origin will be `iosSchemeValue://HostnameValue`.\n\n1. The WebView is not able to display images, videos or other files from file or content protocols or if it doesn't have protocol at all. For those cases use `window.Ionic.WebView.convertFileSrc()` to get the proper url.\n\n1. Replace any usages of `window.Ionic.normalizeURL()` and `window.wkRewriteURL()` with `window.Ionic.WebView.convertFileSrc()`.\n\n    * For Ionic Angular projects, there is an [Ionic Native wrapper](https://beta.ionicframework.com/docs/native/ionic-webview):\n\n        ```\n        npm install @ionic-native/ionic-webview@latest\n        ```\n\n[ionic-homepage]: https://ionicframework.com\n[ionic-docs]: https://ionicframework.com/docs\n[ionic-webview-docs]: https://beta.ionicframework.com/docs/building/webview\n[ionic-support]: https://ionicframework.com/support\n","funding_links":[],"categories":["Cordova plugins","Objective-C"],"sub_categories":["Incompatible"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionic-team%2Fcordova-plugin-ionic-webview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fionic-team%2Fcordova-plugin-ionic-webview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionic-team%2Fcordova-plugin-ionic-webview/lists"}