Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cordova-plugin-hotpushes
Advanced tools
#cordova-plugin-hotpushes
Download and cache remotely hosted content.
This plugin is a work in progress and it is not production ready. PR welcome.
cordova plugin add cordova-plugin-hotpushes
Parameter | Description |
---|---|
options.src | String URL to hot push endpoint |
options.versionFileName | String Name of the json file containing the version information |
options.type | String (Optional) Defines the hot push strategy applied to the content.The type HOTPUSH_TYPE.REPLACE is the default behaviour that completely removes existing content then copies new content from a zip file.The type HOTPUSH_TYPE.MERGE will download and replace only content which has changed. |
options.headers | Object (Optional) Set of headers to use when requesting the remote content from options.src . |
options.archiveURL | String (Mandatory if options.type === Hotpush.HOTPUSH_TYPE.REPLACE ) URL of the zip containing the files to hot push. |
options.documentsPath | Object (Optional) Path to the Documents folder (useful for WKWebView) |
options.checkType | String (Optional) Set to Hotpush.HOTPUSH_CHECK_TYPE.VERSION if you want to use the version number in your version.json instead of timestamp |
options.debug | Boolean (Optional) Print debug information in the console |
HotPush
.var hotpushes = HotPush.sync({
src: 'http://myserver/hot/',
versionFileName: 'version.json',
type: Hotpush.HOTPUSH_TYPE.REPLACE,
archiveURL: 'http://myserver/hot/assets.zip'
});
Load the local files at position -1
(see version.json).
Parameter | Description |
---|---|
no parameters |
Load the local files at position >= 0.
Parameter | Description |
---|---|
no parameters |
Check if there is a new version available on the server.
Parameter | Description |
---|---|
no parameters |
Download the files on the server.
Parameter | Description |
---|---|
no parameters |
Parameter | Description |
---|---|
event | String Name of the event to listen to. See below for all the event names. |
callback | Function is called when the event is triggered. |
The event updateFound
will be triggered when a new update is found on the server.
Callback Parameter | Description |
---|---|
no parameters |
hotpushes.on('updateFound', function() {
hotpushes.update();
});
The event noUpdateFound
will be triggered when no new update is found on the server.
Callback Parameter | Description |
---|---|
no parameters |
hotpushes.on('noUpdateFound', function() {
alert('All good!');
});
The event progress
will be triggered on each update as the native platform downloads and caches the content.
Callback Parameter | Description |
---|---|
data.progress | Integer Progress percentage between 0 - 100 . The progress includes all actions required to cache the remote content locally. This is different on each platform, but often includes requesting, downloading, and extracting the cached content along with any system cleanup tasks. |
data.status | Integer Enumeration of PROGRESS_STATE to describe the current progress state. |
hotpushes.on('progress', function(data) {
// data.progress
// data.status
});
The event updateComplete
will be triggered when the content has been successfully cached onto the device.
Callback Parameter | Description |
---|---|
no parameters |
hotpushes.on('updateComplete', function() {
location.reload();
});
The event error
will trigger when an internal error occurs and the cache is aborted.
Callback Parameter | Description |
---|---|
e | Error Standard JavaScript error object that describes the error. |
hotpushes.on('error', function(e) {
// e.message
});
The event cancel
will trigger when hotpushes.cancel
is called.
Callback Parameter | Description |
---|---|
no parameters |
hotpushes.on('cancel', function() {
// user cancelled the hot push
});
Cancels the content sync operation and triggers the cancel callback.
An enumeration that describes the current progress state.
Integer | Description |
---|---|
0 | STOPPED |
1 | DOWNLOADING |
2 | EXTRACTING |
3 | COMPLETE |
An enumeration that describes the type of hotpush to perform.
String | Description |
---|---|
merge | MERGE |
replace | REPLACE |
An enumeration that describes the field to look at in the version.json
file.
String | Description |
---|---|
version | VERSION |
timestamp | TIMESTAMP |
FAQs
Simple Hot pushes
We found that cordova-plugin-hotpushes 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.