Skip to content

Instantly share code, notes, and snippets.

Atsushi goofmint

Block or report user

Report or block goofmint

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View download.js
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/constructor/i.test(e.HTMLElement),f=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},u="application/octet-stream",s=1e3*40,d=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,s)},c=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(i){f(i)}}}},l=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},p=function(t,
View index.js
document.addEventListener('DOMContentLoaded', async (e) => {
let controller = new AbortController();
document.querySelector('#button').onclick = async (e) => {
try {
const signal = controller.signal;
const result = await fetch('/json', {signal});
document.querySelector('#result').innerText = JSON.stringify(await result.json());
} catch (e) {
console.log(e);
controller = new AbortController();
View index.js
controller = new AbortController();
View index.js
const result = await fetch('/json', {signal});
View index.js
let controller = new AbortController();
const signal = controller.signal;
View index.js
window.matchMedia('(display-mode:standalone)').matches
View index.json
"start_url": "index.html?pwa=true"
View index.js
> document.getElementsByTagName("input")[0].value
"#b51a00"
You can’t perform that action at this time.