
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
cordova-plugin-protocol
Advanced tools
Allows the creation of a custom protocol to serve files locally without using the file scheme.
Allows the creation of a custom protocol to serve files locally without using the file scheme.
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
Allows the creation of a custom protocol to serve files locally without using the file scheme.
We found that cordova-plugin-protocol demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.