Skip to content

Instantly share code, notes, and snippets.

@yuanoook
Created June 17, 2017 16:49
Show Gist options
  • Save yuanoook/39a3629e8cadd35419444bc2cf72f635 to your computer and use it in GitHub Desktop.
Save yuanoook/39a3629e8cadd35419444bc2cf72f635 to your computer and use it in GitHub Desktop.
inbrowser.download.js
function download(url) {
var a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('download', '');
a.click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment