Convert built-in LWTs to static themes
Categories
(Toolkit :: Add-ons Manager, task, P1)
Tracking
()
People
(Reporter: kmag, Assigned: kmag)
References
(Blocks 1 open bug, Regressed 3 open bugs)
Details
Attachments
(24 files, 3 obsolete files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
This allows us to install built-in themes at startup only when they're new, or
have changed, without requiring special work from callers, and in particular
without requiring loading the add-on database when no changes are required.
Assignee | ||
Comment 2•6 years ago
|
||
All of the consumers of this observer really want it to behave like a promise.
And, for the cases where the DB may or may not already be loaded when those
callers run, getting the logic correct is difficult.
This patch replaces the observer with a promise, and also delays the
resolution of that promise until any built-in add-ons registered during
XPIProvider startup have finished installing. This latter feature is currently
unused, but will be necessary after subsequent patches for code that relies
querying the default theme immediately after provider startup.
Assignee | ||
Comment 3•6 years ago
|
||
It's possible for the application install location to vary from session to
session, particularly when the same profile is used with multiple app
versions, or with both packed and unpacked builds. Resolving resource: URIs at
install time causes problems in those instances, since it will always point to
the inital app location.
Resolving the resource URIs at runtime solves this.
Assignee | ||
Comment 4•6 years ago
|
||
When attempting to fetch a local resource which doesn't exist, the fetch
promise rejects, causing the hasResource promise to reject. Since we don't
want hasResource to reject for nonexistent resources, we need to catch this
rejection and treat it as a nonexistent resource.
Assignee | ||
Comment 5•6 years ago
|
||
We want add-ons in the built-in location, particularly the built-in themes, to
appear in the add-on manager so that users can enable and disable them. We
don't want them to be able to uninstall them, though, so this also makes the
built-in location locked.
Assignee | ||
Comment 6•6 years ago
|
||
The filePath property is used in error messages, and is expected to be a
string. Setting it to a nsIFile object makes those error messages inscrutable.
Assignee | ||
Comment 7•6 years ago
|
||
There are all sorts of random issues with rootURI sometimes not being set for
sourceBundle add-ons, or callers expecting sourceBundle to never be null. This
patch fixes all of those issues that I came across.
Assignee | ||
Comment 8•6 years ago
|
||
Most of our tests disable SCOPE_SYSTEM add-ons, which are meant to have been
registered externally, but still rely on SCOPE_APPLICATION addons (i.e., the
default theme), which are meant to be part of the application.
We currently flag the built-in location as SCOPE_SYSTEM in some places and
SCOPE_APPLICATION in others, which leads to those add-ons not being available
to some tests that need them.
Assignee | ||
Comment 9•6 years ago
|
||
We still don't have a great way to bundle localizations for built-in add-ons,
since our localization tools are not compatible with the WebExtension
localization format, and there's no way to fetch locales from language packs.
We used to have a fairly complicated mechanism for this which used localized
preference values, pointing to localized string bundle URLs, based on the
add-on ID and the property we wanted to localized. That seems needlessly
complicated at this point, so this patch just allows overrides in two specific
string bundles, one for toolkit, and one for app-specific extensions.
Assignee | ||
Comment 10•6 years ago
|
||
We have some convoluted packaging logic to automatically package any directory
with a manifest.json file as an XPI. Unfortunately, that logic also applies to
extensions that are supposed to be part of omni.ja.
It would be nice to have a cleaner way to filter out any resources which we've
already flagged to be part of omni.ja, but this patch takes the simpler
approach of just including anything that's in a modules/ directory, which is
whitelisted for omni.ja elsewhere.
Assignee | ||
Comment 11•6 years ago
|
||
Assignee | ||
Comment 12•6 years ago
|
||
Since we want themes to be loaded before the main browser window is loaded, we
really need their resources to be ready as soon as possible. We typically
delay serving moz-extension: requests until the extension is ready, since
extension page and CSS loads rely on the extension being fully initialized.
Image loads, though, are perfectly safe to load as early as we need, so this
patch whitelists them to bypass the delayed load logic.
Assignee | ||
Comment 13•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Assignee | ||
Comment 15•6 years ago
|
||
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Comment 17•6 years ago
|
||
Assignee | ||
Comment 18•6 years ago
|
||
Assignee | ||
Comment 19•6 years ago
|
||
Assignee | ||
Comment 20•6 years ago
|
||
Assignee | ||
Comment 21•6 years ago
|
||
The static theme startup code is both super asynchronous and super
inefficient. It currently takes a noticeable amount of time after startup to
finish its work and apply its theme, which results in the user seeing a flash
of the default theme before their selected them is applied.
This is particularly noticeable when dark mode themes are enabled.
This patch caches the fully-processed theme data in the addonStartup cache,
and applies it immediately after extension startup begins, if it's available.
Assignee | ||
Comment 22•6 years ago
|
||
Assignee | ||
Comment 23•6 years ago
|
||
It's possible for the application install location to vary from session to
session, particularly when the same profile is used with multiple app
versions, or with both packed and unpacked builds. Resolving resource: URIs at
install time causes problems in those instances, since it will always point to
the inital app location.
Resolving the resource URIs at runtime solves this.
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 24•6 years ago
|
||
Assignee | ||
Comment 25•6 years ago
|
||
Assignee | ||
Comment 26•6 years ago
|
||
Assignee | ||
Comment 28•6 years ago
|
||
Jorg, you guys are probably going to need to update your LightweightThemeManager usage and remove your lightweightThemes default preferences, too:
LightweightThemeManager.addBuiltInTheme
is going away, and LightweightThemeManager.currentThemeWithPersistedData
is more or less being replaced with LightweightThemeManager.currentThemeWithFallback
for the time being.
Comment 29•6 years ago
|
||
Thanks for the heads-up. I'll forward this to the add-on and theme guys, fortunately we have more workers now, but I'm happy to be the point of contact.
Comment 30•6 years ago
|
||
Thank you. Kris, could you give us a list of which patches we need to port? Probably every which has changes in browser.
Assignee | ||
Comment 32•6 years ago
|
||
It only works with "persisted" theme images, which no longer exist.
Comment 33•6 years ago
|
||
I notice that you're removing LightweightThemePersister.
Does that not break Android theme support ? On Android, webextension themes didn't work before bug 1429488 because the images were moz-extension:// URIs, which the Android java code had trouble using, so the persister is used to pass non-moz-extension:// URIs.
Assignee | ||
Comment 35•6 years ago
|
||
Assignee | ||
Comment 36•6 years ago
|
||
Updated•6 years ago
|
Comment 37•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cf6d3341f350
https://hg.mozilla.org/mozilla-central/rev/40936b75fd32
https://hg.mozilla.org/mozilla-central/rev/935a2cd834c2
https://hg.mozilla.org/mozilla-central/rev/f595c6ccb68a
https://hg.mozilla.org/mozilla-central/rev/cc45935ed2c2
https://hg.mozilla.org/mozilla-central/rev/e8e9739ac28b
https://hg.mozilla.org/mozilla-central/rev/d7e4177fca6f
https://hg.mozilla.org/mozilla-central/rev/f9e0f5aa1c6d
https://hg.mozilla.org/mozilla-central/rev/7c7df3ee8aaa
https://hg.mozilla.org/mozilla-central/rev/e289c1b047d7
https://hg.mozilla.org/mozilla-central/rev/f31ce378439a
https://hg.mozilla.org/mozilla-central/rev/b62c3bde4bc3
https://hg.mozilla.org/mozilla-central/rev/83612982ab33
https://hg.mozilla.org/mozilla-central/rev/5cbbb63ea73d
https://hg.mozilla.org/mozilla-central/rev/2c10bcdc3d96
https://hg.mozilla.org/mozilla-central/rev/eb90dbf5abc8
https://hg.mozilla.org/mozilla-central/rev/9b72a80ec78c
https://hg.mozilla.org/mozilla-central/rev/9ad35a4e4717
https://hg.mozilla.org/mozilla-central/rev/b7481329e0b7
https://hg.mozilla.org/mozilla-central/rev/b9f524da2a61
https://hg.mozilla.org/mozilla-central/rev/238bd73cdf0b
https://hg.mozilla.org/mozilla-central/rev/1b30a2c10d99
https://hg.mozilla.org/mozilla-central/rev/5d5860192199
https://hg.mozilla.org/mozilla-central/rev/ba1529f7fd78
https://hg.mozilla.org/mozilla-central/rev/824a86797c8e
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Description
•