Anderson Green
Anderson Green

Reputation: 31810

How can I synchronize JavaScript objects between Greasemonkey scripts on different computers?

Is it possible to synchronize JavaScript objects between Greasemonkey scripts? I have created a website blocks script that stores a list of websites to block, as well as a list of websites to allow, but I don't yet know whether Greasemonkey has any methods for synchronizing these variables between different instances of the same script on multiple computers.

Is it possible to synchronize the data that is saved using GM_setValue on multiple computers?

Upvotes: 1

Views: 218

Answers (1)

Brock Adams
Brock Adams

Reputation: 93473

You can synchronize GM_setValues by synchronizing your Firefox preferences. GM_setValue data is stored in the preferences.

For javascript objects, JSON encode them and store them with GM_setValue.

Other than that, you would have to set up a web application, of your own, that would receive, store, and transmit JSON-encoded data. Your script would send and receive using GM_xmlhttpRequest().

Upvotes: 1

Related Questions