From 6fdf7e463ee939c7f8eacf89d820e7ab405de587 Mon Sep 17 00:00:00 2001 From: pennae Date: Mon, 8 Aug 2022 19:10:52 +0200 Subject: properly ignore fenix webchannel errors & add note at least up to 103 there are two webchannel implementations in mobile firefox, one of which should not be there and only responds with error. https://bugzilla.mozilla.org/show_bug.cgi?id=1616635 --- web/js/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/js/main.js b/web/js/main.js index 27d3a1a..278d457 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -13,7 +13,13 @@ class Channel { window.addEventListener( 'WebChannelMessageToContent', ev => { - if (ev.detail && ev.detail.message.error) { + // fenix (at least up to 103) always sends a webchannel error. this + // we'll ignore this error entirely; if we get a legitimate No Such + // Channel we're not set as an account server and could not do much + // useful work anyway. + if (!ev?.detail?.message) + return; + if (ev.detail.message.error) { for (const wait in this.waiting) { this.waiting[wait].reject(new Error(ev.detail.message.error)); } -- cgit v1.2.3