From 74113cd2ad84105069b793ff7b30e3fcea0dd4df Mon Sep 17 00:00:00 2001 From: girst Date: Tue, 31 Dec 2019 17:44:37 +0100 Subject: [PATCH] Ignore error thrown by dispatchDOMEvent Triggered e.g. by `f`-ing on an extension card's description/title. The click still registers, so it's just noise in the log. This bug is present in all supported versions (at least 68..73), but unlikely to be fixed, as it is "only" a testing function (and we're not supposed to use it). NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMWindowUtils.dispatchDOMEventViaPresShellForTesting] --- extension/lib/utils.coffee | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extension/lib/utils.coffee b/extension/lib/utils.coffee index fde3502..4f89bb3 100644 --- a/extension/lib/utils.coffee +++ b/extension/lib/utils.coffee @@ -343,9 +343,13 @@ simulateMouseEvents = (element, sequence, browserOffset) -> element.focus() if type == 'contextmenu' # for element.dispatchEvent(mouseEvent) else - (window.windowUtils.dispatchDOMEventViaPresShellForTesting or - window.windowUtils.dispatchDOMEventViaPresShell # < fx73 - )(element, mouseEvent) + try + (window.windowUtils.dispatchDOMEventViaPresShellForTesting or + window.windowUtils.dispatchDOMEventViaPresShell # < fx73 + )(element, mouseEvent) + catch error + if error.result != Cr.NS_ERROR_UNEXPECTED + throw error return -- 2.39.3