Bug 1531584 - catch promise error when updating a11y menu item when DOMWalker connection is already closed. r=gl
authorYura Zenevich <yura.zenevich@gmail.com>
Wed, 13 Mar 2019 15:44:55 +0000
changeset 464387 31dc14d0b906
parent 464386 3903ec67f703
child 464388 eca35ef284c1
push id35716
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:42:17 +0000
treeherdermozilla-central@8ee97c045359 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1531584
milestone67.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 1531584 - catch promise error when updating a11y menu item when DOMWalker connection is already closed. r=gl Differential Revision: https://phabricator.services.mozilla.com/D23321
devtools/client/inspector/markup/markup-context-menu.js
--- a/devtools/client/inspector/markup/markup-context-menu.js
+++ b/devtools/client/inspector/markup/markup-context-menu.js
@@ -752,18 +752,20 @@ class MarkupContextMenu {
       menu.append(menuitem);
     }
 
     menu.popup(screenX, screenY, this.toolbox);
     return menu;
   }
 
   async _updateA11YMenuItem(menuItem) {
-    const hasMethod = await this.target.actorHasMethod("domwalker",
-                                                       "hasAccessibilityProperties");
+    const hasMethod = await this.target.actorHasMethod(
+      "domwalker", "hasAccessibilityProperties").catch(
+        // Connection to DOMWalker might have been already closed.
+        error => console.warn(error));
     if (!hasMethod) {
       return;
     }
 
     const hasA11YProps = await this.walker.hasAccessibilityProperties(
       this.selection.nodeFront);
     if (hasA11YProps) {
       this.toolbox.doc.getElementById(menuItem.id).disabled = menuItem.disabled = false;