Share your repls and programming experiences

← Back to all posts
Cross origin 'localStorage' for storing information between websites!
ExplosionScratc (506)

This is a very simple repl. And it solves a problem I have quite frequently. When I code something cool, and I want it to work with another project that I code, usually I need some way to share data. Often I'll make a small server just for this, but I thought, why not generalize it? So I made this. See browser.js for the JS file to put in your project, then you can do this:

await storage.setItem("hello", "world");
//Now somewhere else you can do:
await storage.getItem("hello");//"world"

How does this store, and is my data safe?

Yup! This takes IP adress and browser user agent and hashes them into a string. This means that nobody can decrypt it, but that string is unique to your computer and browser. This also means that your data is invulnerable to clearing cookies, restarting computers, or anything else.