merge from cpu hotfix, renamed sharePanel unload to shutdown
This commit is contained in:
Коммит
05cf66084c
|
@ -104,17 +104,17 @@ sharePanel.prototype = {
|
|||
}
|
||||
}, false);
|
||||
this.loadListener = function (evt) {
|
||||
self.attachMessageListener();
|
||||
self.window.setTimeout(function () {
|
||||
self.sizeToContent();
|
||||
}, 0);
|
||||
};
|
||||
this.browser.addEventListener("load", this.loadListener, true);
|
||||
Services.obs.addObserver(this, 'content-document-global-created', false);
|
||||
|
||||
let webProgress = this.browser.webProgress;
|
||||
this.stateProgressListener = new StateProgressListener(this);
|
||||
webProgress.addProgressListener(this.stateProgressListener, Ci.nsIWebProgress.NOTIFY_STATE_WINDOW);
|
||||
|
||||
|
||||
// Extend Services object
|
||||
XPCOMUtils.defineLazyServiceGetter(
|
||||
Services, "bookmarks",
|
||||
|
@ -123,29 +123,13 @@ sharePanel.prototype = {
|
|||
);
|
||||
},
|
||||
|
||||
unload: function () {
|
||||
Services.obs.removeObserver(this, 'content-document-global-created');
|
||||
shutdown: function () {
|
||||
let webProgress = this.browser.webProgress;
|
||||
webProgress.removeProgressListener(this.stateProgressListener);
|
||||
this.stateProgressListener = null;
|
||||
},
|
||||
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
if (!aSubject.location.href) {
|
||||
return;
|
||||
}
|
||||
|
||||
// is this window a child of OUR XUL window?
|
||||
let mainWindow = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
mainWindow = mainWindow.wrappedJSObject ? mainWindow.wrappedJSObject : mainWindow;
|
||||
if (mainWindow !== this.panel.ownerDocument.defaultView) {
|
||||
return;
|
||||
}
|
||||
|
||||
attachMessageListener: function () {
|
||||
// listen for messages now
|
||||
let self = this;
|
||||
let contentWindow = this.browser.contentWindow;
|
||||
|
@ -523,7 +507,7 @@ sharePanel.prototype = {
|
|||
return null;
|
||||
return url;
|
||||
},
|
||||
|
||||
|
||||
previews: function () {
|
||||
// Look for FB og:image and then rel="image_src" to use if available
|
||||
// for og:image see: http://developers.facebook.com/docs/share
|
||||
|
|
Загрузка…
Ссылка в новой задаче