unadlib / origin-storage Goto Github PK
View Code? Open in Web Editor NEWA same-origin storage(IndexedDB/WebSQL/localStorage) for cross-domain access
License: MIT License
A same-origin storage(IndexedDB/WebSQL/localStorage) for cross-domain access
License: MIT License
Hi,
I have received the following error:
index.cjs.development.js?5d91:1011 In 'OriginStorage' class, the listen method 'connect' is NOT decorated by decorator '@listen' or be added 'listenKeys' list.
Any solution?
Dependencies:
origin-storage: ^1.0.0
vue: ^2.6.11
node: v14.16.0
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?
Let's assume that I have:
sub1.example.com
sub2.example.com
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?
Hello, i have code on website: https://yeda-crossdomain-storage.web.app/
const originStorage = new OriginStorage({
broadcastChanges: true
});
and i have client code:
const client = new OriginStorageClient({
uri: 'https://yeda-crossdomain-storage.web.app',
storageOptions: { name: 'yeda_auth' },
});
But all saved data stored on my client domain.
Storage website data always empty.
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?
Anyway to make this easily work with an IndexedDB wrapper like DexieJS?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.