Bug 1261375 fix load handling in pocket panel, r?gijs draft
authorShane Caraveo <scaraveo@mozilla.com>
Thu, 28 Apr 2016 11:13:32 -0700
changeset 357420 b8eb8d24817602ff7ea7b601fd95116941422692
parent 357082 f1ff46a78fa5f30b208b33269b48ba4ba367b34f
child 519641 98ac950f7e06331079dfb9bc16464bca23bbc40f
push id16777
push usermixedpuppy@gmail.com
push dateThu, 28 Apr 2016 18:13:45 +0000
reviewersgijs
bugs1261375
milestone49.0a1
Bug 1261375 fix load handling in pocket panel, r?gijs MozReview-Commit-ID: GXpr29vw9Qu
browser/extensions/pocket/content/Pocket.jsm
--- 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);