Clean up GlobalPopupNotifications.sys.mjs to remove "Argument 1 is not an object" error
Categories
(Thunderbird :: Add-Ons: General, defect)
Tracking
(Not tracked)
People
(Reporter: TbSync, Assigned: TbSync)
References
Details
Attachments
(1 file)
We forked toolkit's PopupNotifications.sys.mjs as GlobalPopupNotifications.sys.mjs. We have missed an upstream change in one of its dependencies, which causes the following error
ChromeUtils.getClassName: Argument 1 is not an object
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Comment 1•2 months ago
|
||
We forked toolkit's PopupNotifications.sys.mjs
1 as
GlobalPopupNotifications.sys.mjs
2, but missed an upstream change in
one of its dependencies, which causes the following error
ChromeUtils.getClassName: Argument 1 is not an object
when installing an add-on and acknowledging the required notification
popups. A test case which throws the error without this patch is the
following add-on:
https://addons.thunderbird.net/addon/openai-proofreader
STR:
- download the add-on's XPI file
- open Thunderbird's add-on manager
- click on the gear icon and select "install from file"
- select the downloaded XPI file
- click "Add" on the shown notification
- observe the error in the console
- click "Ok" on the second notification
- observe the error in the console
There are two reasons for the fail:
-
We register event listeners to directly call
PopupNotifications
,
which is a function (prototyped to behave like a class) defined in the
same file, instead ofownerGlobal.PopupNotifications
, which is the
lazy getter defined inmessenger.js
3 to the global instance of
that class. The constructor of course does not know what to do with the
passed in event and dies. -
There is no reason at all to register these listeners, as those
events are already handled bypopupnotification.js
4. They could be
registered to prevent the default event handler, but we are also not
doing that.
This patch is also following upstream in how to handle the no-shadow
lint issue, to make it easier to find relevant code.
Updated•2 months ago
|
Assignee | ||
Updated•2 months ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/6a1aa977133b
Clean up GlobalPopupNotifications.sys.mjs to remove "Argument 1 is not an object" error. r=arschmitz
Description
•