Bug 1409705 - Adding Cu.isDeadWrapper(window) to avoid accessing dead object r?honza draft
authorRicky Chien <ricky060709@gmail.com>
Thu, 11 Jan 2018 18:03:48 +0800
changeset 718988 2292cd906fd225a30660573946cddeda5142757d
parent 718845 4db166f0442dddc5b9011c722d7499501fedf283
child 745678 c7a4e5fb307da061ba6e0fd4376bbd4b7bc80000
push id95131
push userbmo:rchien@mozilla.com
push dateThu, 11 Jan 2018 10:04:45 +0000
reviewershonza
bugs1409705
milestone59.0a1
Bug 1409705 - Adding Cu.isDeadWrapper(window) to avoid accessing dead object r?honza MozReview-Commit-ID: 1Qpb6p2Jwnz
devtools/server/actors/tab.js
--- a/devtools/server/actors/tab.js
+++ b/devtools/server/actors/tab.js
@@ -1639,17 +1639,17 @@ DebuggerProgressListener.prototype = {
       if (request.status != Cr.NS_OK) {
         // Instead, listen for DOMContentLoaded as about:neterror is loaded
         // with LOAD_BACKGROUND flags and never dispatches load event.
         // That may be the same reason why there is no onStateChange event
         // for about:neterror loads.
         let handler = getDocShellChromeEventHandler(progress);
         let onLoad = evt => {
           // Ignore events from iframes
-          if (evt.target == window.document) {
+          if (!Cu.isDeadWrapper(window) && evt.target === window.document) {
             handler.removeEventListener("DOMContentLoaded", onLoad, true);
             this._tabActor._navigate(window);
           }
         };
         handler.addEventListener("DOMContentLoaded", onLoad, true);
       } else {
         // Somewhat equivalent of load event.
         // (window.document.readyState == complete)