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
This commit is contained in:
Yura Zenevich
2019-03-13 15:44:55 +00:00
parent b78bcc19ea
commit 372b28bce4

View File

@@ -757,8 +757,10 @@ class MarkupContextMenu {
}
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;
}