Created
March 28, 2017 06:40
-
-
Save johnslipper/713eb94a5996b4667bdf4188919cfc2a to your computer and use it in GitHub Desktop.
Console Save Bookmarklet - Allows saving of JS objects to a file
This file contains 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
javascript:(console.save=function(e,o){if(!e)return void console.error('Console.save: No data');o||(o='console.json'),'object'==typeof e&&(e=JSON.stringify(e,void 0,4));var n=new Blob([e],{type:'text/json'}),t=document.createEvent('MouseEvents'),a=document.createElement('a');a.download=o,a.href=window.URL.createObjectURL(n),a.dataset.downloadurl=['text/json',a.download,a.href].join(':'),t.initMouseEvent('click',!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(t)}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment