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

js-file-download

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-file-download - npm Package Compare versions

Comparing version 0.4.9 to 0.4.10

18

file-download.js

@@ -5,5 +5,5 @@ module.exports = function(data, filename, mime, bom) {

if (typeof window.navigator.msSaveBlob !== 'undefined') {
// IE workaround for "HTML7007: One or more blob URLs were
// revoked by closing the blob for which they were created.
// These URLs will no longer resolve as the data backing
// IE workaround for "HTML7007: One or more blob URLs were
// revoked by closing the blob for which they were created.
// These URLs will no longer resolve as the data backing
// the URL has been freed."

@@ -13,11 +13,11 @@ window.navigator.msSaveBlob(blob, filename);

else {
var blobURL = window.URL.createObjectURL(blob);
var blobURL = (window.URL ? window.URL : window.webkitURL).createObjectURL(blob);
var tempLink = document.createElement('a');
tempLink.style.display = 'none';
tempLink.href = blobURL;
tempLink.setAttribute('download', filename);
tempLink.setAttribute('download', filename);
// Safari thinks _blank anchor are pop ups. We only want to set _blank
// target if the browser does not support the HTML5 download attribute.
// This allows you to download files in desktop safari if pop up blocking
// This allows you to download files in desktop safari if pop up blocking
// is enabled.

@@ -27,6 +27,6 @@ if (typeof tempLink.download === 'undefined') {

}
document.body.appendChild(tempLink);
tempLink.click();
// Fixes "webkit blob resource error 1"

@@ -33,0 +33,0 @@ setTimeout(function() {

{
"name": "js-file-download",
"version": "0.4.9",
"version": "0.4.10",
"description": "Javascript function that triggers browser to save javascript-generated content to a file",

@@ -5,0 +5,0 @@ "main": "file-download.js",

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