Bug 1261375 fix load handling in pocket panel, r?gijs
MozReview-Commit-ID: GXpr29vw9Qu
--- a/browser/extensions/pocket/content/Pocket.jsm
+++ b/browser/extensions/pocket/content/Pocket.jsm
@@ -35,18 +35,21 @@ var Pocket = {
// in lieu of an AfterViewShowing event, just spin the event loop.
window.setTimeout(function() {
if (urlToSave) {
window.pktUI.tryToSaveUrl(urlToSave, titleToSave);
} else {
window.pktUI.tryToSaveCurrentPage();
}
+ // pocketPanelDidHide in main.js set iframe to about:blank when it was
+ // hidden, make sure we're loading the save panel.
if (iframe.contentDocument &&
- iframe.contentDocument.readyState == "complete") {
+ iframe.contentDocument.readyState == "complete" &&
+ iframe.contentDocument.documentURI != "about:blank") {
window.pktUI.pocketPanelDidShow();
} else {
// iframe didn't load yet. This seems to always be the case when in
// the toolbar panel, but never the case for a subview.
// XXX this only being fired when it's a _capturing_ listener!
iframe.addEventListener("load", Pocket.onFrameLoaded, true);
}
}, 0);