WebExtension with type="bootstrap" doesn't load after a restart
Categories
(Thunderbird :: Add-Ons: General, defect)
Tracking
(thunderbird68?)
Tracking | Status | |
---|---|---|
thunderbird68 | ? | --- |
People
(Reporter: standard8, Assigned: darktrojan)
References
(Regression)
Details
(Keywords: regression)
In the latest nightly I converted my add-on from install.rdf to manifest.json due to the changes in bug 1552634.
I installed a new version of the add-on into the latest Daily and it worked fine.
When I restarted, the add-on did not run. On the browser console was a message:
Error: Cannot find loader for bootstrap XPIProvider.jsm:1805:15
I don't think this is due to my add-on, since that installs fine when Daily is already running.
Assignee | ||
Comment 1•5 years ago
|
||
That's … odd. It's looking for something to parse an install.rdf. A caching problem, perhaps?
Reporter | ||
Comment 2•5 years ago
|
||
I guess that could have been referring to something old.
However, I am still seeing issues, and I can now see where the issue is. In startup()
in bootstrap.js
my add-on is doing this:
Services.obs.addObserver({
observer() {
// do some initialisation
}
}, "final-ui-startup");
That observer now never gets fired, which seems to be a breaking change.
Based on the mailing list I tried changing to mail-startup-done
.
When I did this, I dragged and dropped my updated extension to the add-ons manager and restarted Daily. At this stage the mail-startup-done
observer did not fire.
I tried with adding various console debug and installing the extension in the same way, and the new debug wouldn't fire. Eventually, I removed the add-on completely, restarted, and installed again. After a restart it all worked fine.
After more testing, and some removal of the console debug I got into the same state again - mail-startup-done wouldn't fire. Uninstalling & re-installing would fix it again.
I've tried it again a few times, but now I'm in the state where whatever I do it seems to work fine.
This still has me concerned though, as could there now be a timing issue, and we're not guaranteed to see that notification? We need this to ensure that we set up everything correctly in the window when we start up.
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
We need this to ensure that we set up everything correctly in the window when we start up.
If you're doing things with a window you should be checking if the load
event has already fired (document.readyState == "complete"
), or otherwise, listening for the load
event. Using observers for that job is not really a good practice.
Reporter | ||
Comment 4•5 years ago
|
||
Unfortunately load
isn't likely to be good enough. It'll likely fire before the rest of the UI startup is done, which a) could affect performance, b) could mean the UI isn't actually in a setup state where we can attach everything an insert columns etc.
I could try it, but I do think that at the moment this change is unexpected and undocumented and hence could affect a few add-ons.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
I've updated https://developer.thunderbird.net/add-ons/tb68/bootstrapped#possible-timing-issues, which was already there but I made a few changes. There's not really a lot we can do other than making sure what we document is accurate, so I'm WONTFIXing this (for want of a better resolution).
Description
•