Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daniellizik-sc/01fef2d9804b8afc1c6d7dbdaf8f30e2 to your computer and use it in GitHub Desktop.
Save daniellizik-sc/01fef2d9804b8afc1c6d7dbdaf8f30e2 to your computer and use it in GitHub Desktop.
save
!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var r=n(12),i=n(14),a=o(i),u=n(15),c=o(u),l=n(16),d=o(l),s=(0,c["default"])();(0,a["default"])(s,"script").forEach(function(e){return e.parentNode.removeChild(e)}),(0,a["default"])(s,"link").forEach(function(e){return(0,d["default"])(e,"href")}),(0,a["default"])(s,"img").forEach(function(e){return(0,d["default"])(e,"src")});var f="<!doctype HTML>"+s.outerHTML,p="data:text/html;charset=UTF-8;base64,",v=btoa(unescape(encodeURIComponent(f))),w="\n Enter number corresponding to desired option:\n\n 1. Download as html file\n 2. Download as encoded base64 text file\n 3. Open as base64 data url in new tab (must allow popups on this page)\n",m=prompt(w),h={1:function(e){return(0,r.saveAs)(new Blob([f],{type:"text/html;charset=utf-8"}),e)},2:function(e){return(0,r.saveAs)(new Blob([p+v],{type:"text/plain"}),e)},3:function(){return window.open(p+v)}};null!==m&&m!==!1&&void 0!==m&&h[m](/1|2/i.test(m)?prompt("filename? be sure to add file extension"):void 0)},,,,,,,function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},,,,,function(e,t,n){var o,r,i=i||function(e){"use strict";if(!("undefined"==typeof e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/constructor/i.test(e.HTMLElement),u=/CriOS\/[\d]+/.test(navigator.userAgent),c=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},l="application/octet-stream",d=4e4,s=function(e){var t=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};setTimeout(t,d)},f=function(e,t,n){t=[].concat(t);for(var o=t.length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){c(i)}}},p=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},v=function(t,c,d){d||(t=p(t));var v,w=this,m=t.type,h=m===l,y=function(){f(w,"writestart progress write writeend".split(" "))},b=function(){if((u||h&&a)&&e.FileReader){var o=new FileReader;return o.onloadend=function(){var t=u?o.result:o.result.replace(/^data:[^;]*;/,"data:attachment/file;"),n=e.open(t,"_blank");n||(e.location.href=t),t=void 0,w.readyState=w.DONE,y()},o.readAsDataURL(t),void(w.readyState=w.INIT)}if(v||(v=n().createObjectURL(t)),h)e.location.href=v;else{var r=e.open(v,"_blank");r||(e.location.href=v)}w.readyState=w.DONE,y(),s(v)};return w.readyState=w.INIT,r?(v=n().createObjectURL(t),void setTimeout(function(){o.href=v,o.download=c,i(o),y(),s(v),w.readyState=w.DONE})):void b()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return t=t||e.name||"download",n||(e=p(e)),navigator.msSaveOrOpenBlob(e,t)}:(w.abort=function(){},w.readyState=w.INIT=0,w.WRITING=1,w.DONE=2,w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null,m)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof e&&e.exports?e.exports.saveAs=i:null!==n(7)&&null!==n(13)&&(o=[],r=function(){return i}.apply(t,o),!(void 0!==r&&(e.exports=r)))},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){return[].slice.call(e.querySelectorAll(t))}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(){var e=(document.createDocumentFragment(),document.createElement("html"));return e.innerHTML=document.documentElement.innerHTML,e}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){var n=e.getAttribute(t).trim();/\/\/|~\//.test(n.slice(0,2))?n=window.location.protocol+"//"+n.slice(2):"/"===n.charAt(0)?n=window.location.origin+"/"+n.slice(1):"http"!==n.slice(0,4)&&(n=window.location.origin+"/"+n);var o=(window.location.host.split("/"),n.split("/")),r=o.slice(3),i=o[0]+"//"+o[2]+"/"+r.filter(function(e){return""!==e&&".."!==e}).join("/");e.setAttribute(t,i)}}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment