summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-08-08 19:10:52 +0200
committerpennae <github@quasiparticle.net>2022-08-08 19:10:52 +0200
commit6fdf7e463ee939c7f8eacf89d820e7ab405de587 (patch)
tree254663ad8bee8f0080ecb3e13faba9ddedd0d297
parent651d0f24c76a7c61b63155acf8a24119a59ad9cd (diff)
downloadminor-skulk-6fdf7e463ee939c7f8eacf89d820e7ab405de587.tar.gz
minor-skulk-6fdf7e463ee939c7f8eacf89d820e7ab405de587.tar.xz
minor-skulk-6fdf7e463ee939c7f8eacf89d820e7ab405de587.zip
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
-rw-r--r--web/js/main.js8
1 files changed, 7 insertions, 1 deletions
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));
}