39 loadInProgress:
false,
52 loadRuntimeOverlays:
function loadRuntimeOverlays() {
54 var overlays = this.getOverlaysForTarget(
"windowtype:*");
58 var windowType = document.documentElement.getAttribute(
"windowtype");
59 if (windowType !=
null && windowType !=
"") {
60 overlays = overlays.concat(this.getOverlaysForTarget(
"windowtype:" + windowType));
64 if (overlays.length > 0) {
65 this.loadOverlayList(overlays);
68 this.sendOverlayEvent();
76 sendOverlayEvent:
function sendOverlayEvent() {
77 var e = document.createEvent(
"Events");
78 e.initEvent(
"sb-overlay-load",
false,
true);
79 document.dispatchEvent(e);
80 this.loadCompleted =
true;
86 loadOverlayList:
function loadOverlayList(overlays) {
88 dump(
"\n\nOverlayLoader.loadOverlayList()\n\t+");
89 dump(overlays.join(
"\n\t+") +
"\n\n");
92 if (this.loadInProgress) {
93 dump(
"\n\nOverlayLoader.loadOverlayList() already in progress!");
96 this.loadInProgress =
true;
100 document._loadOverlayInUse = document.loadOverlay;
101 document.loadOverlay =
function() {
102 var caller =
"unknown";
104 caller = document.loadOverlay.caller.name;
106 dump(
"\n\n\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
107 dump(
"WARNING: Someone is attempting to use document.loadOverlay while\n");
108 dump(
" loadPlayerOverlays() is in progress. This cannot be allowed\n");
109 dump(
" as simultaneous loadOverlay calls will clobber each other.\n");
110 dump(
" For more information see Mozilla Bug 330458.\n\n");
111 dump(
" Possible culprit: " + caller +
"()\n");
112 dump(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n\n\n\n");
122 if (overlays.length > 0) {
123 var overlay = overlays.pop();
124 dump(
"\nOverlayLoader.loadPlayerOverlays() loading overlay " + overlay +
"\n");
127 document._loadOverlayInUse(overlay, observer);
131 dump(
"\nOverlayLoader.loadPlayerOverlays() finished loading overlays\n");
132 document.loadOverlay = document._loadOverlayInUse;
144 var checkCompleted =
function() {
146 Components.utils.reportError(
147 "An extension overlay has failed to load.\n\n" +
148 "Known causes include: \n" +
149 " - a malformed overlay file\n" +
150 " - an overlay which is itself the target of an overlay.\n\n" +
151 "Open the Add-Ons window and disable extensions one by one until " +
152 "you have isolated which extension is causing the problem.\n\n"+
153 "Please report this error to the extension author, or " +
154 "http://bugzilla.songbirdnest.com.");
171 getOverlaysForTarget:
function getOverlaysForTarget(targetURL) {
173 var targetURI = Components.classes[
"@mozilla.org/network/io-service;1"]
174 .getService(Components.interfaces.nsIIOService)
181 var addURIs =
function(enumerator) {
182 while (enumerator.hasMoreElements()) {
183 uriList.push( enumerator.getNext()
184 .QueryInterface(Components.interfaces.nsIURI)
190 var chromeRegistry = Components.classes[
"@mozilla.org/chrome/chrome-registry;1"]
191 .getService(Components.interfaces.nsIXULOverlayProvider);
192 addURIs(chromeRegistry.getXULOverlays(targetURI));
193 addURIs(chromeRegistry.getStyleOverlays(targetURI));
202 window.addEventListener(
"load",
function() {
OverlayLoader.loadRuntimeOverlays();},
false);
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
sbDeviceFirmwareAutoCheckForUpdate prototype observe