Created
April 30, 2015 18:51
-
-
Save JavaScript-Packer/7b9946b223ebca74a0d8 to your computer and use it in GitHub Desktop.
Automatic downloading JavaScript source code with blobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // click on generated href link dynamically created and attached to page | |
| var Δ="script.js",data="alert('THIS IS A TEST');",d="download",$="setAttribute",_=document, | |
| r=new Blob([data],{type:"text/plain;charset=utf8;"}),e=_.createElement("a"); | |
| void 0!==e[d]?(e[$]("href",window.URL.createObjectURL(r)),e[$](d,Δ)):e[$]("href","http://www.whak.com"), | |
| e.click(),_.body.appendChild(e); | |
| //automatic downloader, download pops up right after page load |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment