Changes

Jump to: navigation, search

CloudServices/Sync/FxSync/Developer/ClientAPI

986 bytes removed, 22:01, 24 September 2010
Installing your classes into Weave
Cu.import("resource://services-sync/engines.js");
== Installing your classes into Weave Sync ==
[TODO describe where to put all You can register your code and how to make it into importable modules] In the file <tt>weave/chrome/content/fx-weave-overlay.js</tt>, find the function <tt>FxWeaveGlue()</tt>, and within the <tt>try</tt> block import your Engine class, instantiate it, and register it with Weave. Like so: <pre> function FxWeaveGlue() { //... etc ... try { Cu.import("resource://weave/engines/bookmarks.jsengine in an "); Weave.Engines.register(new BookmarksEngine());  Cu.import("resource://weave/engines/history.js"); Weave.Engines.register(new HistoryEngine());  //.. etc ...  // Your engine here: Cu.import("resourceservice://weave/engines/foo.jsready"); Weave.Engines.register(new FooEngine());  } catch (e) { //... etc ... // In the latest Weave, You can register your engine in anywhere that you // can access observer using the Weave.Engines.register function. Please be noted Note that the // parameter you passed should be the name of your engine, such as // Weave.Engines.register(FooEngine), but and not new FooEngine().</pre> To make your engine work in Fennec, you must also add the same code to the function <tt>FennecWeaveGlue()</tt> in the file <tt>weave/chrome/content/fennec-weave-overlay.js</tt>.
== Updating the Weave preferences screen ==
Canmove, confirm
725
edits

Navigation menu