dhruvagarwal / geekometer

This chrome extension keeps a track of the problems solved by you on geeksforgeeks.org, and crosses them out.Hence, easing it out for you to concentrate on missed ones
Apache License 2.0
36 stars 16 forks source link

geeksquiz.com matching #2

Open PritishC opened 10 years ago

PritishC commented 10 years ago

Hey, your latest master branch code doesn't include the changes from PR #1.

It would be nice if you could re-introduce those changes please.

Edit: After a bit of debugging, I see why you had to remove the feature. localStorage is different for different domains. Surely there must be a way to overcome this problem. It seems that most solutions which try to grow the concept of localStorage into cross-domain functionality depend on server-side changes.

Can't we store the data elsewhere?

dhruvagarwal commented 10 years ago

According to the same origin policy .. we can't access localStorage or cookies of any other domain. some solutions that come to my mind is going cloud but that'll take too much of an effort... what do you say ?

PritishC commented 10 years ago

Cloud will indeed take too much effort.

  1. From where will we get a cloud server for ourselves?
  2. If the users of this extension grow exponentially, we will have a lot of data to store and will be limited by the cloud server. However, I don't think this would be too much of a problem - after all, it's barely kilobytes of data per user. It depends on how often G4G adds more and more articles.

Imo the client-side storage solution is perfect - the users store the data for themselves - it's just the different domains that are hampering us. Can we not access localStorage of the two domains separately and combine it into a single key or something similar?

The problem with using an invisible iframe to make localStorage cross-domain (as all solutions so far have suggested) is that the changes must be made server-side. And globalStorage is now defunct.

Also, I found PouchDB but I'm not sure if it would work.

I think we ought to request the moderators of geeksforgeeks to add the iframe bit to their servers. We ought to reason with them that the extension will benefit users a lot. Other than this, we could look at solutions which don't involve a front-end (like the widget you've made). I'm out of ideas.