Closed Bug 1312416 Opened 8 years ago Closed 8 years ago

WhatsApp extension causing error in console on notification

Categories

(Core :: Audio/Video: Playback, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: jkt, Assigned: Gijs)

References

()

Details

Attachments

(1 file)

I'm getting the following error every time I get a notification from WhatsApp:

TypeError: box.getNotificationWithValue is not a function 1 browser-media.js:257:9
	receiveMessage chrome://browser/content/browser-media.js:257:9

This extension: https://addons.mozilla.org/en-US/firefox/addon/whatsapp-desktop/

I don't have any other app that uses these notification indicators, however causing a chrome error is likely it happens on all.

/cc Gijs as mentioned in a previous bug to you.
A couple of things:
First, WhatsApp Desktop appears to use the add-on SDK, it is not a WebExtension.
But second, the line of code from the error message (http://searchfox.org/mozilla-central/source/browser/base/content/browser-media.js#257) is inside gDecoderDoctorHandler.receiveMessage().  It is possible the the sdk notifications library or something within the extension is causing this breakage but Johnathan, are you pretty sure this bug is connected to WhatsApp?
Flags: needinfo?(jkt)
Extensively tested over a long period, I would only be getting the errors when the notification appeared.

This is the version of the addon I'm using: https://dxr.mozilla.org/addons/source/602010 I can't see anything within it calling gDecoderDoctorHandler.receiveMessage directly or overloading it etc.
Flags: needinfo?(jkt) → needinfo?(aswan)
Component: WebExtensions: General → General
Product: Toolkit → Firefox
I don't really have much to add, so I'll resort to speculation: is it possible that the extension is putting some into content in a panel or notification box or something that isn't a regular tab but that triggers the decode doctor?
Also, publicly available version of that file:
https://addons.mozilla.org/en-US/firefox/files/browse/497826/file/lib/common.js#top
Flags: needinfo?(aswan)
Presumably this is happening because the message is coming from a <browser> in a popup, but the decoder doctor code is assuming that it belongs to a tab. So, presumably the site that they load into the browser is trying to play a video.

I guess we should probably just ignore the notification in that case.
It seems to be playing the audio even, the correct thing for the user to do would be to show that notification in the curent selected tab much like the nightly slow down notifications for extensions appear. I'm not very familiar with the decoder doctor, is that the code responsible for the tab playing icon?
Moving to "Audio/Video: Playback" as that component owns the gDecoderDoctorHandler code which I think should handle the off screen case caused by the addon.
Component: General → Audio/Video: Playback
Product: Firefox → Core
(In reply to Kris Maglione [:kmag] from comment #6)
> Presumably this is happening because the message is coming from a <browser>
> in a popup, but the decoder doctor code is assuming that it belongs to a
> tab. So, presumably the site that they load into the browser is trying to
> play a video.
> 
> I guess we should probably just ignore the notification in that case.

I know that we can load frame scripts only for tabbed browsers - presumably we can also attach listeners to only be attached to tabbed browsers?
(In reply to :Gijs Kruitbosch from comment #9)
> I know that we can load frame scripts only for tabbed browsers - presumably
> we can also attach listeners to only be attached to tabbed browsers?

Yeah: getGroupMessageManager("browsers").addMessageListener(...)

That's probably a better option.
Comment on attachment 8805604 [details]
Bug 1312416 - use tabbrowser message manager group to listen for decoder doctor messages,

https://reviewboard.mozilla.org/r/89358/#review88574
Attachment #8805604 - Flags: review?(jaws) → review+
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/9f0e99ac3fca
use tabbrowser message manager group to listen for decoder doctor messages, r=jaws
https://hg.mozilla.org/mozilla-central/rev/9f0e99ac3fca
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Jonathan, can you verify this is fixed on today's Nightly?
Flags: needinfo?(jkt)
Sorry didn't see the needinfo, yes this now isn't causing the same error.
Thanks!
Flags: needinfo?(jkt)
You need to log in before you can comment on or make changes to this bug.