Created
March 16, 2020 09:25
-
-
Save kkoziarski/31544cfb03fd5a5eb526fa691c1dd3d0 to your computer and use it in GitHub Desktop.
copy JWT token bookmarklet (jwt-cp)
This file contains hidden or 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
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