Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/main.js

Issue 29325137: Issue 2950 - Don`t rely on Services.mm, it isn`t available before Gecko 39 (Closed)
Patch Set: Created Aug. 27, 2015, 12:12 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/composer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/main.js
===================================================================
--- a/lib/main.js
+++ b/lib/main.js
@@ -43,20 +43,22 @@ request.addEventListener("load", functio
let styleURI = Services.io.newURI("data:text/css," + encodeURIComponent(data), null, null);
styleService.loadAndRegisterSheet(styleURI, Ci.nsIStyleSheetService.USER_SHEET);
onShutdown.add(() => styleService.unregisterSheet(styleURI, Ci.nsIStyleSheetService.USER_SHEET));
}, false);
request.send(null);
// Load our developer tools actor
let frameScript = "chrome://elemhidehelper/content/frameScript.js?" + elementMarkerClass;
-Services.mm.loadFrameScript(frameScript, true);
+let messageManager = Cc["@mozilla.org/globalmessagemanager;1"]
+ .getService(Ci.nsIFrameScriptLoader);
+messageManager.loadFrameScript(frameScript, true);
onShutdown.add(() => {
- Services.mm.removeDelayedFrameScript(frameScript);
- Services.mm.broadcastAsyncMessage("ElemHideHelper:Shutdown");
+ messageManager.removeDelayedFrameScript(frameScript);
+ messageManager.QueryInterface(Ci.nsIMessageBroadcaster).broadcastAsyncMessage("ElemHideHelper:Shutdown");
});
// Load overlay asynchonously and start attaching to windows once done
request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIJSXMLHttpRequest);
request.open("GET", "chrome://elemhidehelper/content/overlay.xul");
request.addEventListener("load", function(event)
{
if (onShutdown.done)
« no previous file with comments | « chrome/content/composer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld