Skip to content

Instantly share code, notes, and snippets.

@zetavg
Last active December 9, 2020 08:33
Show Gist options
  • Save zetavg/fb2b820f5724805efe345f41864c959a to your computer and use it in GitHub Desktop.
Save zetavg/fb2b820f5724805efe345f41864c959a to your computer and use it in GitHub Desktop.
Inject GraphQL Explorer on any webpage, good for hacking sites that uses cookies for GraphQL requests. Usage: copy the content of inject-graphiql.js, open Devtools on the target page and paste it into the JavaScript Console , modify "put_your_endpoint_here" and hit enter to execute.
function injectGraphiQL(endpoint) {
window.GRAPHQL_ENDPOINT = endpoint;
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'https://zetavg.github.io/github-page-for-hosting-things/js/graphiql-for-injection.js';
document.body.innerHTML = '';
document.getElementsByTagName('head')[0].appendChild(newScript);
}
injectGraphiQL(put_your_endpoint_here);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment