Last active
January 19, 2022 15:25
-
-
Save CezaryDanielNowak/bd1fc785aaf65677dd870d01bec8508d to your computer and use it in GitHub Desktop.
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
/** | |
* Transfer localStorage easly with chrome console. | |
* Paste this into web console of source page, then paste function's result to destination console. | |
**/ | |
(function() { | |
let result = 'localStorage.clear();\n'; | |
Object.keys(localStorage).forEach((key) => { | |
result += `localStorage["${key}"] = ${JSON.stringify(localStorage[key])};\n` | |
}); | |
result += `window.location = "${window.location.href.replace(window.location.origin, '')}"`; | |
console.log(result); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment