Skip to content

Instantly share code, notes, and snippets.

@KiraStack
Created January 30, 2026 17:55
Show Gist options
  • Select an option

  • Save KiraStack/a3f537d0828fd12ba576aeaabaa4b9d3 to your computer and use it in GitHub Desktop.

Select an option

Save KiraStack/a3f537d0828fd12ba576aeaabaa4b9d3 to your computer and use it in GitHub Desktop.
The snippet temporarily injects an iframe to access Discord’s same-origin localStorage, reads a stored token, parses it, then logs it.
// inject
const iframe = document.createElement('iframe');
// stdout
console.log(
'Token: %c%s',
'font-size:16px;',
JSON.parse(
document.body.appendChild(iframe)
.contentWindow
.localStorage
.token
)
);
// cleanup
iframe.remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment