Created
March 4, 2018 20:03
-
-
Save kirjavascript/eff6c155d509c932fad3d37fbca6879f to your computer and use it in GitHub Desktop.
worst api ever
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
const http = new Proxy({}, { | |
get(t, k) { | |
const url = `https://crossorigin.me/http://${k.replace(/_/g, '.')}`; | |
return new Proxy({}, { | |
get(t, k) { | |
fetch(url) | |
.then(res => res.text()) | |
.then(res => { | |
(new Function(`return (${k})(\`${res.replace(/`/g, '\\`')}\`)`))() | |
}); | |
} | |
}); | |
} | |
}); | |
// do a fetch request | |
http.www_google_com[(src) => { | |
console.log(src); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment