Firefox 4 comes soon (ok, next year ;)) and there is a Firefox plugin to sync your bookmarks etc. with Firefox 3.whatever .
I would like to know if anyone has a comprehensive, up-to-date tutorial to integrate Firefox Sync into your own plugin? Or any idea regarding this?
I mainly followed this official "tutorial" and also this blog post, but the information seems to be slight开发者_如何学编程ly outdated.
For example, the object is not calledWeave
anymore but Engines
and the weave.engines.
preference became services.sync.engines.
. I played a little with all the mentioned options, but it does not seems to work (and my plugin does not show up in list where you can select what to sync).
I assume that the Tracker
and Store
classes are fine, the main problem is to register the engine...
The ClientAPI tutorial you mention is definitely the way to go. I updated it recently so if something's not working, please let us know so I can fix it in the docs. Wladimir's blogpost is definitely quite old and contains some outdated information. We will also make changes to some parts of the API in the upcoming beta releases, so be prepared for some flux...
The Weave
namespace is still the canonical way to access Sync related APIs from UI code. It exposes components such as Weave.Service
and Weave.Engines
. You can import it via Components.utils.import("resource://services-sync/main.js")
. If you want to implement your own engine, you'll have to import the actual underlying modules, though (all listed in the ClientAPI tutorial). The tutorial also describes how to register your custom engine implementation. Once it's registered, it won't automatically show up in the preferences UI, though. I suggest building your own UI that flips the services.sync.engine.YOURENGINE
pref in your add-on's preferences.
Out of curiosity, what kind of data are you trying to sync?
精彩评论