Created
August 28, 2018 21:31
-
-
Save sandipchitale/58675be947f2cff57339a91a09247697 to your computer and use it in GitHub Desktop.
Scan session storage for JWT access tokens
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
function tryFromStorage() { | |
chrome.tabs.executeScript(null, { | |
code: ` | |
(function readFrom(result) { | |
([window.sessionStorage, window.localStorage]).forEach(function(storage) { | |
for (let i = 0; i < storage.length; ++i) { | |
const key = storage.key(i); | |
if (key.includes('access')) { | |
result.push(storage.getItem(key)); | |
} | |
} | |
}); | |
return result; | |
})([]) | |
` | |
//'sessionStorage.getItem(\'infoarchive.iawa.access_token\')' | |
}, function(accessTokens) { | |
return accessTokens; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment