Question

I am currently trying to make a browser plugin using crossrider that will sync bookmarks but as there is no "on new bookmark" event how do I sync all upload new bookmarks to the server and update bookmarks lists on other connected machines in realtime? I would be inclined to do this with a websocket but as I said it is not event based. So do I poll all the clients every n seconds? That seems like a lot of data being moved and it seems taxing on the server as the process presumably wold include: first requesting all the clients bookmarks every n seconds and then comparing them to a list of the clients logged bookmars and, in the event of a match, update the clients browser's bookmarks. So in short, what is the best solution to the conundrum?

Was it helpful?

Solution

Given the scenario you describe, I think that polling it the best solution.

If I correctly understand the intention of your extension, the one thing I would do differently is how you compare the bookmarks. In your solution, you mention sending the bookmarks data to the server, comparing, and sending data back to the client to update the browser bookmarks.

I think a better more efficient solution would be to compare the bookmarks on the client-side and send new bookmarks to the server. You can store a snapshot of the bookmarks for use when comparing using our local database appAPI.db.async API and our appAPI.request API to send the new bookmarks to your server.

We at Crossrider are here to help you with any issues or questions you might have. Hence, if you need any assistance, please do not hesitate to contact our support (support@crossrider.com).

Disclaimer: I am a Crossrider employee.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top