Giter VIP home page Giter VIP logo

origin-storage's People

Contributors

caitlinweb avatar dependabot[bot] avatar unadlib avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

origin-storage's Issues

Support objects as values: JSON.parse error when getItem() value is Array

First of all, this is a great library that I want to use for my project. I was already using localForage and needed a way to sync data between domains.

However, I can't use this because I'm storing arrays and OriginStorageClient expects strings for getItem(). For example OriginStorageClient.getItem(key) fails with a JSON.parse error:

Uncaught (in promise) SyntaxError: Unexpected token 'o', "[object Obj"... is not valid JSON

localForage already handles decoding and encoding the value as needed. Can this library be updated to remove any changes to values in getItem() and setItem()? In other words, let localForage handle the values.

How are you controlling security?

How are you controlling security?

Let's assume that I have:

  • sub1.example.com
  • sub2.example.com
    and they are using this library by sharing data with the origin set to a page on example.com.

Couldn't I set up sub1.example.com.malicious.com and point it to the origin set on example.com and then see all of the data in any user's browser whom I can trick into going to my malicious site?

How to wait for connection to complete before calling localstorage functions in client?

Thanks again for merging my PR! I'm still stuck on the onConnect/connection part so I have a few questions if you don't mind. I thought of a couple ways but they seem hacky to me, so wanted to get your input.

What's the purpose behind the required onConnect if _isConnected is false when it's called?

How can I wait for the connection to be complete (ie _isConnected = true) before calling localforage functions? Do you have a working example you could share?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.