- Use nsIXULRuntime to get prefers-reduced-motion instead of the hidden window
- Use nsIScreenManager to get the resolution of the primary display instead of the hidden window
Differential Revision: https://phabricator.services.mozilla.com/D219721
For starters, replace all newtab styles and functions. Since we're
removing these styles, I conformed the asrouter admin to the reusable
components team's design tokens. So, it now uses global system page
styles. This is a pretty general overhaul since there are so many styles
to replace. In addition to the style changes, I've added a new Filters
UI and moved the groups table to the General tab. This allows us to
remove the Message Groups tab since that functionality is now rolled
into the Filters UI. The same with the Private Browsing tab: when you
hit Show on a pb_newtab message, it will open a PB window and override
the message. And you can filter by template now, so you can view only PB
messages on the General tab. I also fixed spellchecking. Instead of
spellchecking, which only works for natural languages, we just validate
that the text is valid JSON. If it's not valid, we show a red border on
the textarea. That way messages won't just mysteriously fail to show. I
also moved a few elements around to conserve space. Now, everything
should be able to fit on the screen of a default window size of 1500px.
Finally, I removed some old cruft that was left over from when the admin
interface was part of the newtab page.
Differential Revision: https://phabricator.services.mozilla.com/D213865
This patch updates the targeting for two in-tree messages that include “source == ‘startup’” in their targeting and are triggered on default browser check. There are currently edge cases where these messages can collide with about:welcome. See [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1897804#c4 | this comment ]] for steps to replicate an example.
By adding additional targeting that ensures this isn’t the user’s first session, we can avoid about:welcome collisions.
Differential Revision: https://phabricator.services.mozilla.com/D213456
Also add a global `browserIsSelected` context property for all triggers,
so you can entirely avoid showing a message if the triggering browser
was in the background. You can use the selector and the context property
together or separately.
Context targeting:
`browserIsSelected`
Background tab selector:
`#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab%`
Current tab selector:
`#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab%[visuallyselected]`
Child of tab selector:
`#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab% .tab-icon-image`
Differential Revision: https://phabricator.services.mozilla.com/D212494
Also add a global `browserIsSelected` context property for all triggers,
so you can entirely avoid showing a message if the triggering browser
was in the background. You can use the selector and the context property
together or separately.
Context targeting:
`browserIsSelected`
Background tab selector:
`#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab%`
Current tab selector:
`#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab%[visuallyselected]`
Child of tab selector:
`#tabbrowser-tabs:not([overflow]):not([haspinnedtabs]) %triggerTab% .tab-icon-image`
Differential Revision: https://phabricator.services.mozilla.com/D212494
The newtab page is styled according to a `lwt-newtab-brighttext`
attribute, which until now is only present in the newtab page, and not
exposed to the chrome. This is a problem for elements like feature
callouts, which we want to fit in with the newtab content, even though
they exist in the chrome. That's okay in many cases, because the
callouts also use theme properties, and there's usually a concordance
between `lwt-newtab-brighttext` and the content color scheme. But in a
few older (but very popular) themes, there are missing theme properties,
and it's possible for the newtab page to be very dark even though
prefers-color-scheme is not dark.
This patch resolves the issue by exposing `lwt-newtab-brighttext` to the
chrome, and using that attribute to theme newtab callouts.
Differential Revision: https://phabricator.services.mozilla.com/D208256