Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
copy JWT token bookmarklet (jwt-cp)
javascript: (function() {
var key = window.localStorage.getItem('adal.token.keys').split('|')[0];
var token = window.localStorage.getItem('adal.access.token.key' + key);
if (token) {
/*window.prompt("Copy to clipboard: Ctrl+C, Enter", token);*/
sendToClipbord(token);
}
function sendToClipbord(myString) {
var textarea = document.createElement('textarea');
document.body.appendChild(textarea);
textarea.value = myString;
textarea.style.position = 'fixed';
textarea.focus();
textarea.select();
document.execCommand('Copy');
textarea.remove();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment