Bug 1409705 - Adding Cu.isDeadWrapper(window) to avoid accessing dead object r=Honza
authorRicky Chien <ricky060709@gmail.com>
Thu, 11 Jan 2018 18:03:48 +0800
changeset 450782 8b29651a367a0ff830bc64800752a3a6caffa484
parent 450781 1fc038162868151da0d94f6cb29d7a8e5a0651a6
child 450783 698ae46fa6340bfc93f5e9f212391bf8bc6feaa5
push id8543
push userryanvm@gmail.com
push dateTue, 16 Jan 2018 14:33:22 +0000
treeherdermozilla-beta@a6525ed16a32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1409705
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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)