Socket
Book a DemoInstallSign in
Socket

cordova-plugin-protocol

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-protocol

Allows the creation of a custom protocol to serve files locally without using the file scheme.

1.0.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Cordova Plugin Protocol

Allows the creation of a custom protocol to serve files locally without using the file scheme.

Usage

Once the plugin installed, change the content location in your config.xml:

<content src="protocol-plugin:///index.html" />

The host location can be anything as it is ignored while serving files locally, you just need to respect a url format.

To allow the scheme to be used, you will also need to add this configuration for the cordova-plugin-whitelist:

<allow-navigation href="protocol-plugin://*/*" />

This will by default serve the files located in your www directory. You can change this by setting Root in the preferences:

<preference name="Root" value="<your root directory>"/>

You can also choose a different scheme by setting the Scheme preference:

<preference name="Scheme" value="<your scheme>"/>

If you do so, you will have to update the content, and allow-navigation directives too.

FAQs

Package last updated on 05 Jun 2018

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.