commit ccbeedc15b9a79fe446eccf601de9b2f8ada69c0
parent 3706be695cc9087443c59dd433987ed434199b39
Author: Ryan Wolf <rwolf@borderstylo.com>
Date: Wed, 13 Oct 2010 14:59:58 -0700
doesn't need to wait for page laod
Diffstat:
1 file changed, 10 insertions(+), 25 deletions(-)
diff --git a/chrome/content/content.js b/chrome/content/content.js
@@ -1,26 +1,11 @@
-window.addEventListener(
- "load",
- function () {
- gBrowser.addEventListener(
- "DOMContentLoaded",
- function (event) {
- var doc = event.originalTarget;
+new function () {
+ var css = "chrome://mft3k/skin/stylesheets/binding.css";
- // don't add binding to frames
- if (doc.defaultView.frameElement) return;
-
- var styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"].
- getService(Ci.nsIStyleSheetService);
- var IOService = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var flashHackURI = IOService.
- newURI("chrome://mft3k/skin/stylesheets/binding.css", null, null);
- var type = styleSheetService.USER_SHEET;
- styleSheetService.
- loadAndRegisterSheet(flashHackURI, styleSheetService.USER_SHEET);
- },
- false
- );
- },
- false
-);
+ // See: https://developer.mozilla.org/en/Using_the_Stylesheet_Service
+ var styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"].
+ getService(Ci.nsIStyleSheetService);
+ var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+ var sheet = ios.newURI(css, null, null);
+ var type = styleSheetService.USER_SHEET;
+ styleSheetService.loadAndRegisterSheet(sheet, type);
+}