keifufu / WebNowPlaying

WebNowPlaying browser extension. Provides support for browser-based players
MIT License
81 stars 10 forks source link

Firefox Addon "Bad source or badly formatted message, skipping" from bootstrap-content-message-handler.js - console spam #30

Closed OneNot closed 8 months ago

OneNot commented 8 months ago

I'm seeing a spam of:

Handling window message [bootstrap-content-message-handler.js:167:21](moz-extension://ab53cc0e-d7fc-4dfe-8d84-71c9e7ffc4e0/content/bootstrap-content-message-handler.js)
Bad source or badly formatted message, skipping. [bootstrap-content-message-handler.js:171:25](moz-extension://ab53cc0e-d7fc-4dfe-8d84-71c9e7ffc4e0/content/bootstrap-content-message-handler.js)

in the browser console in Firefox v121.0.1 using WebNowPlaying v3.0.1. As in, like 10 times a second or something. I'm not sure what it's actually skipping, or how much of a problem it actually is. The spam certainly wasn't helpful when trying use the console to debug my userscripts on youtube though lol

keifufu commented 8 months ago

WebNowPlaying does not print such messages, this must be another extension? From a quick search it might be BitWarden. I use BitWarden myself but cannot replicate such behavior. Please confirm if this is caused by BitWarden, and if it is I would appreciate it if you were to upload the related file (bootstrap-content-message-handler.js) here.

OneNot commented 8 months ago

Hmm interesting... You are right, it's Bitwarden, but the behaviour starts and stops as I enable/disable the WebNowPlaying addon... here's the file (zipped because apparently Github doesn't let you upload .js files here)

keifufu commented 8 months ago

I can replicate this now and this is indeed very annoying. WebNowPlaying uses window messages to communicate, just like BitWarden seems to do for some cases. The issue is that BitWarden decides to log on each message, no matter what data it contains. I could "fix" the "Bad source..." warning but it'd still print "Handling window message" annoyingly. Consider opening a PR or issue on BitWarden to only log if a message came from its own scripts. As a temporary workaround you can just disable debug messages in the developer tools since these are printed with console.debug.

OneNot commented 8 months ago

Got it. Thanks for looking into it.