Socket
Socket
Sign inDemoInstall

cordova-plugin-injectview

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-plugin-injectview

Automatically inject Cordova platform and plugin scripts into your site.


Version published
Weekly downloads
28
decreased by-41.67%
Maintainers
1
Install size
13.4 kB
Created
Weekly downloads
 

Readme

Source

cordova-plugin-injectview

Automatically inject Cordova platform and plugin scripts into your site.

Setup

This plugin supports Android and iOS.

cordova plugin add cordova-plugin-injectview

Usage

Adding the plugin to your project is sufficient.

At runtime, when a page loads in the Cordova-hosted web view, this plugin injects Cordova's platform scripts as well as all of your plugin scripts into the web view. By doing this, you can integrate Cordova with a remotely hosted site without needing to explicitly include Cordova script tags or do request rewrites to load your Cordova plugin scripts.

How It Works

This plugin registers a number of Cordova hooks in plugin.xml that execute update-manifest.js. This script parses each of your project configurations located at platforms/{platform}/{platform}.json and generates a manifest file, cordova-plugin-injectview.json, that contains relative paths to Cordova's platform scripts as well as your plugin scripts. This manifest file gets compiled into your app as a resource.

At runtime, this plugin hooks into the web view's page load event: onPageFinished for Android, CDVPageDidLoadNotification for iOS. Once the event fires, this plugin parses the manifest to determine all script paths, reads each script, concatenates everything into one large script, then evaluates the whole thing using the web view's JavaScript engine.

License

Copyright © 2015 Fabian Strachanski
Copyright © 2016 Sam Beran
Copyright © 2020 Chris Schmich
MIT License. See LICENSE for details.

Keywords

FAQs

Last updated on 05 Sep 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc