The previous changes to the Spotlight schema made one of the logo.imageURL or
logo.imageId required. However, this is not backwards compatible with the older
Firefoxen, so we have to support the case where `logo` is present (e.g., for
`image.size`) without either of those properties, but `logoImageURL` *is*
present.
Differential Revision: https://phabricator.services.mozilla.com/D140761
In migrating from Ajv 6 to @cfworker/json-schema, some schemas will no longer
validate due to the `format: uri` annotation only being a suggestion for
strings in Ajv 6. Our URLs that use %PLACEHOLDERS% (e.g., `%LOCALE%`) will not
pass validation as URIs due to being interpreted as invalid URL encoding.
Here we add a facade in front of @cfworker/json-schema which defines a
`moz-url-format` format for strings, which runs them through
Services.urlFormatter.formatURL before attempting to validate them as URIs. We
don't simply find-replace all %PLACEHOLDERS% because the URL formatter service
only supports certain variables and will leave undefined variables as-is,
leading to a validation error (which is what we want).
Differential Revision: https://phabricator.services.mozilla.com/D138926
In migrating from Ajv 6 to @cfworker/json-schema, some schemas will no longer
validate due to the `format: uri` annotation only being a suggestion for
strings in Ajv 6. Our URLs that use %PLACEHOLDERS% (e.g., `%LOCALE%`) will not
pass validation as URIs due to being interpreted as invalid URL encoding.
Here we add a facade in front of @cfworker/json-schema which defines a
`moz-url-format` format for strings, which runs them through
Services.urlFormatter.formatURL before attempting to validate them as URIs. We
don't simply find-replace all %PLACEHOLDERS% because the URL formatter service
only supports certain variables and will leave undefined variables as-is,
leading to a validation error (which is what we want).
Differential Revision: https://phabricator.services.mozilla.com/D138926
This patch ended up adding some complexity to about:welcome, as the
language switching needs to eagerly perform fallible asynchronous
actions. Specifically it needs to get the list of addons and
pre-emptively install the langpack, which can take time, and can fail.
This necessitated building a custom React components and custom hooks to
be able to deal with these requirements.
The following command will allow for the testing of this feature.
./mach run \
--temp-profile \
--setpref "extensions.getAddons.langpacks.url=https://mock-amo-language-tools.glitch.me/?app=firefox&type=language&appversion=%VERSION%" \
--setpref "intl.multilingual.aboutWelcome.languageMismatchEnabled=true" \
--setpref "intl.multilingual.aboutWelcome.systemLocaleOverride=es-ES" `#(optional)` \
-- --new-tab about:welcome
Differential Revision: https://phabricator.services.mozilla.com/D138831
This patch ended up adding some complexity to about:welcome, as the
language switching needs to eagerly perform fallible asynchronous
actions. Specifically it needs to get the list of addons and
pre-emptively install the langpack, which can take time, and can fail.
This necessitated building a custom React components and custom hooks to
be able to deal with these requirements.
The following command will allow for the testing of this feature.
./mach run \
--temp-profile \
--setpref "extensions.getAddons.langpacks.url=https://mock-amo-language-tools.glitch.me/?app=firefox&type=language&appversion=%VERSION%" \
--setpref "intl.multilingual.aboutWelcome.languageMismatchEnabled=true" \
--setpref "intl.multilingual.aboutWelcome.systemLocaleOverride=es-ES" `#(optional)` \
-- --new-tab about:welcome
Differential Revision: https://phabricator.services.mozilla.com/D138831
Added placeholder for Colorway Closet.
It is enabled by toggling the pref `browser.newtabpage.activity-stream.colorway-closet.enabled`
Differential Revision: https://phabricator.services.mozilla.com/D136761