All Projects → TruckMovers → Cordova Plugin Remote Injection

TruckMovers / Cordova Plugin Remote Injection

Licence: apache-2.0
DEPRECATED: Cordova plugin to allow a remote site to interact with cordova's javascript APIs when loaded within a cordova app.

Projects that are alternatives of or similar to Cordova Plugin Remote Injection

Cordova Plugin Admob Free
Cordova AdMob Plugin
Stars: ✭ 508 (+464.44%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Disable Bitcode
Cordova plugin to disable bitcode in iOS build settings
Stars: ✭ 19 (-78.89%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Camera Preview
Cordova plugin that allows camera interaction from HTML code
Stars: ✭ 528 (+486.67%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Geofence
Geofencing plugin for cordova
Stars: ✭ 261 (+190%)
Mutual labels:  cordova, cordova-plugin
Cl.kunder.webview
This cordova plugin enables you to open a second webview
Stars: ✭ 36 (-60%)
Mutual labels:  cordova, cordova-plugin
Vue Cordova
Vue.js plugin for Cordova
Stars: ✭ 328 (+264.44%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Linkedin
Cordova plugin for LinkedIn
Stars: ✭ 17 (-81.11%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (-48.89%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Wechat
A cordova plugin, a JS version of Wechat SDK
Stars: ✭ 1,198 (+1231.11%)
Mutual labels:  cordova, cordova-plugin
Awesome Cordova Plugins
A curated list of awesome Cordova Apache Plugins https://cordova.apache.org/plugins/
Stars: ✭ 33 (-63.33%)
Mutual labels:  cordova, cordova-plugin
scanbot-sdk-example-ionic
Scanbot scanner SDK example app for Ionic with Cordova.
Stars: ✭ 24 (-73.33%)
Mutual labels:  cordova, cordova-plugin
Blinkid Cordova
ID scanning for cross-platform apps built with Cordova and Phonegap.
Stars: ✭ 44 (-51.11%)
Mutual labels:  cordova, cordova-plugin
ionic-native-sms-retriever-plugin-master
Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.
Stars: ✭ 16 (-82.22%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Qrscanner
A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
Stars: ✭ 485 (+438.89%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (-43.33%)
Mutual labels:  cordova, cordova-plugin
Cordova Admob Pro
🔥 Cordova Plugin for Google AdMob, DFP, ADX. Easy monetization using mobile Ad, with single line of JavaScript. Compatible with Cordova CLI, Inoic, PhoneGap Build, etc.
Stars: ✭ 690 (+666.67%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-dbcopy
Copy SQLite Database from www folder to default app database location
Stars: ✭ 90 (+0%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-flurryanalytics
Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
Stars: ✭ 23 (-74.44%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Permissionscope
🔓 Cordova plugin to handle iOS permissions
Stars: ✭ 27 (-70%)
Mutual labels:  cordova, cordova-plugin
Ionic4
This repo contains example code for ionic4. Get Step by Step tutorial of this repo examples using https://ampersandacademy.com/tutorials/ionic-framework-4
Stars: ✭ 37 (-58.89%)
Mutual labels:  cordova, cordova-plugin

Deprecation Notice

As the casual onlooker can tell this repo hasn't been updated in a while. Unfortunately this project is deprecated. If anyone would like to fork it and address issues please do so but PRs won't be reviewed and merged into this repo. Cordova is not simple to test (or at least wasn't when this was maintained) and I don't have the time to contribute to maintaining it.

If the repos is forked and maintained let me know and we'll link to your repo here.

  • Brad Reynolds

The remote injection plugin allows a remote site to interact with cordova's javascript APIs when loaded within your cordova app. When compared with a cordova app that packages its HTML the downside to loading a remote site is if the network is down your app is down. This can be an acceptable trade off if your site has a heavy dependency on web services. The advantage to this approach is the build, deployment, and previous investment of an existing site doesn't need to change and can continue to work for browser based users providing a smooth transition to an app which provides tighter native integration.

Features

  • Injects cordova and installed plugin JS into the webview for any remotely browsed page allowing them the same access to the cordova object and its plugins as a packaged cordova app.
  • After a developer defined interval will prompt the user if the loading of the main site is taking too long. The user's options are to wait or retry. If the user waits the prompt will be displayed again after the developer defined interval. If the site loads while the dialog is displayed the dialog is dismissed.
  • Support for iOS and Android platforms.
  • Supports both UIWebView and WKWebView on iOS out of the box (added in v0.4.0).

Installation

cordova plugin add cordova-plugin-remote-injection

Configuration

Configuration is done via preferences in your config.xml.

CRIInjectFirstFiles

<preference name="CRIInjectFirstFiles" value="www/js/init.js" />
Type
String
Default
none

List of paths to JS files within the project to inject before injecting cordova into the remote site. To inject multiple separate the files with a ",".

CRIPageLoadPromptInterval

<preference name="CRIPageLoadPromptInterval" value="5" />
Type
int
Default
10

If the site hasn't loaded after this interval the user will be provided a choice to continue waiting or to retry loading the site. This is turned on by default. If not wanting the prompt the user set the value to 0.

CRIShowConnectionErrorDialog

<preference name="CRIShowConnectionErrorDialog" value="0" />

iOS only

Type
int
Default
1

By default the iOS app will display a dialog if there is a failure to connect to the site. This creates issues if wanting to use Cordova's ErrorUrl config to handle connection errors. "0" will turn off displaying of the dialog and allow the ErrorUrl config to kick in.

FAQ

1. Will Apple approve the app if it just wraps a site? Point 2.12 in their guidelines states:

2.12 Apps that are not very useful, unique, are simply web sites bundled as Apps, or do not provide any lasting entertainment value may be rejected

I make no promises for your app but our app was approved by Apple and is in the App Store. We feel we enhanced our site with the app and are not simply bundling it. We display the website but also provide notifications to our users for important events, badge count updates for alerts, etc. Our app is also specifically for the customers of our company and not general use so that may have been a factor in their decision although all we can do is speculate.

2. Will the plugin work with CSP?

Content Security Policy (CSP) is a cool thing. For the plugin to work you'll need to allow javascript to be executed and javascript data URIs.

The default policy generated by the cordova CLI will work with this plugin. At the point in time this was written the policy was:

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">

The key to making the plugin work on Android is to ensure that you allow data URIs to be executed in the origin of which the page is served.

The most restrictive way to specify this is:

script-src 'self' data:;

For more on the topic see issue #6.

Support

Log issues on github and we'll get in contact.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].