Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron-dl

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-dl - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

23

index.js

@@ -8,4 +8,3 @@ 'use strict';

const app = electron.app;
const shell = electron.shell;
const {app, shell} = electron;

@@ -40,3 +39,3 @@ function getFilenameFromMime(name, mime) {

if (webContents.getType() === 'webview') {
hostWebContents = webContents.hostWebContents;
({hostWebContents} = webContents);
}

@@ -63,2 +62,6 @@ const win = electron.BrowserWindow.fromWebContents(hostWebContents);

if (typeof options.onStarted === 'function') {
options.onStarted(item);
}
item.on('updated', () => {

@@ -98,3 +101,11 @@ receivedBytes = [...downloadItems].reduce((receivedBytes, item) => {

if (state === 'interrupted') {
if (options.unregisterWhenDone) {
session.removeListener('will-download', listener);
}
if (state === 'cancelled') {
if (typeof options.onCancel === 'function') {
options.onCancel(item);
}
} else if (state === 'interrupted') {
const message = pupa(errorMessage, {filename: item.getFilename()});

@@ -112,6 +123,2 @@ electron.dialog.showErrorBox(errorTitle, message);

if (options.unregisterWhenDone) {
session.removeListener('will-download', listener);
}
cb(null, item);

@@ -118,0 +125,0 @@ }

{
"name": "electron-dl",
"version": "1.11.0",
"version": "1.12.0",
"description": "Simplified file downloads for your Electron app",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -118,2 +118,9 @@ # electron-dl [![Build Status](https://travis-ci.org/sindresorhus/electron-dl.svg?branch=master)](https://travis-ci.org/sindresorhus/electron-dl)

#### onStarted
Type: `Function`
Optional callback that receives the [download item](https://electronjs.org/docs/api/download-item).
You can use this for advanced handling such as canceling the item like `item.cancel()`.
#### onProgress

@@ -125,2 +132,8 @@

#### onCancel
Type: `Function`
Optional callback that receives the downloadItem for which the download has been cancelled.
#### openFolderWhenDone

@@ -127,0 +140,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc