🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

react-file-download

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-file-download - npm Package Compare versions

Comparing version

to
0.3.5

@@ -13,9 +13,19 @@ module.exports = function(data, filename, mime) {

var tempLink = document.createElement('a');
tempLink.style.display = 'none';
tempLink.href = blobURL;
tempLink.setAttribute('download', filename);
tempLink.setAttribute('target', '_blank');
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
// is enabled.
if (typeof tempLink.download === 'undefined') {
tempLink.setAttribute('target', '_blank');
}
document.body.appendChild(tempLink);
tempLink.click();
document.body.removeChild(tempLink);
window.URL.revokeObjectURL(blobURL);
}
}
{
"name": "react-file-download",
"version": "0.3.4",
"description": "React component that trigger browser to save javascript-generated content to a file",
"version": "0.3.5",
"description": "This package has been deprecated! Please use js-file-download instead",
"main": "file-download.js",

@@ -11,3 +11,3 @@ "scripts": {

"type": "git",
"url": "git@github.com:kennethjiang/react-file-download.git"
"url": "git@github.com:kennethjiang/js-file-download.git"
},

@@ -23,5 +23,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/Rhumbix/react-file-download/issues"
"url": "https://github.com/kennethjiang/js-file-download/issues"
},
"homepage": "https://github.com/Rhumbix/react-file-download"
"homepage": "https://github.com/kennethjiang/js-file-download"
}