Electrolysis/Jetpack: Difference between revisions

Jump to navigation Jump to search
m
Shortened some code snippets
m (Clarifications about existing CPOW limitations)
m (Shortened some code snippets)
Line 59: Line 59:
   addEventListener("tabs.onReady",
   addEventListener("tabs.onReady",
     function(event) {
     function(event) {
       var signature = event.getData("signature").QueryInterface(Components.interfaces.nsIVariant);
       var signature = event.getData("signature").QueryInterface(Ci.nsIVariant);
       sendAsyncMessage("tabs.onReady", {callback: signature});
       sendAsyncMessage("tabs.onReady", {callback: signature});
     }, false, true);
     }, false, true);
Line 86: Line 86:
Some jetpacks do things like the following:
Some jetpacks do things like the following:


   var win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
   var win = Cc["@mozilla.org/appshell/window-mediator;1"]
             .getService(Components.interfaces.nsIWindowMediator)
             .getService(Ci.nsIWindowMediator)
             .getMostRecentWindow("navigator:browser");
             .getMostRecentWindow("navigator:browser");


I'm not yet sure what the best way to deal with this is.  Perhaps create an API that wraps the window mediator and allows you to get specific window CPOWs in well-defined ways?  Perhaps proxying the window mediator component to return CPOWs or something?
I'm not yet sure what the best way to deal with this is.  Perhaps create an API that wraps the window mediator and allows you to get specific window CPOWs in well-defined ways?  Perhaps proxying the window mediator component to return CPOWs or something?
874

edits

Navigation menu