Commit Graph

3192 Commits

Author SHA1 Message Date
Dão Gottwald
da226549e3 Bug 1968264 - Look at a theme's accentcolor (if there's no background image) to determine lwtheme-brighttext. a=dmeehan DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D251015

Differential Revision: https://phabricator.services.mozilla.com/D252457
2025-06-05 12:57:09 +00:00
Mark Banner
4529a8e15d Bug 1881701 - Change new .eslintrc.mjs files to modules (browser/), and export as flat config. r=frontend-codestyle-reviewers,extension-reviewers,pip-reviewers,credential-management-reviewers,search-reviewers,places-reviewers,omc-reviewers,migration-reviewers,home-newtab-reviewers,urlbar-reviewers,aminomancer,daisuke,dimi,robwu,jteow,mconley
Differential Revision: https://phabricator.services.mozilla.com/D249949
2025-05-24 17:11:02 +00:00
Mark Banner
d7c7c5369b Bug 1881701 - Rename many ESLint files to use .mjs. r=frontend-codestyle-reviewers,perftest-reviewers,Gijs,sparky,webcompat-reviewers,twisniewski
This is separate to help preserve history of the files.

Differential Revision: https://phabricator.services.mozilla.com/D249945
2025-05-24 17:10:51 +00:00
iulian moraru
4efa73aa61 Revert "Bug 1946600 - Add browserSetting verticalTabs. r=zombie,webidl,smaug" for causing multiple issues.
This reverts commit 0f9c499eaf.
2025-05-23 18:28:51 +00:00
Christina Lin
0f9c499eaf Bug 1946600 - Add browserSetting verticalTabs. r=zombie,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D247436
2025-05-23 15:54:34 +00:00
Rob Wu
9ba56ee726 Bug 1964857 - Enable UI to remove Extensions Button r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D250081
2025-05-22 22:32:11 +00:00
Rob Wu
a57beb800d Bug 1966935 - Record telemetry when button is temporarily visible r=willdurand
To minimize the amount of new test logic, this commit adds lightweight
test helpers to head_unified_extensions.js, and inserts the relevant
checks in existing test files that exercise the code paths that trigger
the relevant cases.

Differential Revision: https://phabricator.services.mozilla.com/D249920
2025-05-22 22:32:08 +00:00
Rob Wu
fa7be7d762 Bug 1966935 - Record when Extensions app menu item is clicked r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D249919
2025-05-22 22:32:04 +00:00
Rob Wu
a484cec889 Bug 1966935 - Record when the user hides/unhides the Extensions Button r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D249918
2025-05-22 22:32:00 +00:00
Rob Wu
264a6df298 Bug 1966935 - Record whether the user prefers a hidden Extensions button r=willdurand
This allows us to measure how many % of the users have configured the
button to be hidden.

Differential Revision: https://phabricator.services.mozilla.com/D249917
2025-05-22 22:31:57 +00:00
Rob Wu
ad06d60b0b Bug 1948261 - Add "Pin extension to toolbar" checkbox in postinstall r=zombie,fluent-reviewers,bolsson
This adds the "Pin extension to toolbar" checkbox to the post-install
doorhanger, and ensures that the checkbox has a state that reflects the
actual placement of the button, including externally triggered changes.

Differential Revision: https://phabricator.services.mozilla.com/D250324
2025-05-22 13:07:06 +00:00
Sandor Molnar
6e6ee29021 Revert "Bug 1948261 - Add "Pin extension to toolbar" checkbox in postinstall r=zombie,fluent-reviewers,bolsson" for causing toolbar related bc failures
This reverts commit 5fdd2188e8.
2025-05-22 12:18:25 +00:00
Rob Wu
5fdd2188e8 Bug 1948261 - Add "Pin extension to toolbar" checkbox in postinstall r=zombie,fluent-reviewers,bolsson
This adds the "Pin extension to toolbar" checkbox to the post-install
doorhanger, and ensures that the checkbox has a state that reflects the
actual placement of the button, including externally triggered changes.

Differential Revision: https://phabricator.services.mozilla.com/D250324
2025-05-22 10:36:13 +00:00
Rob Wu
873cfadac3 Bug 1948260 - Show button when attention dot is requested r=willdurand
Unlike all previous conditions, the unhidden button cannot easily be
hidden, because the attention dot can currently not easily be dismissed.
To support users who prefer to ignore attention requests in favor of the
extension button being hidden more often, this behavior can be disabled
by setting the extensions.unifiedExtensions.button.ignore_attention
preference to true.

Differential Revision: https://phabricator.services.mozilla.com/D248166
2025-05-22 02:04:31 +00:00
Rob Wu
9169bcc64a Bug 1948260 - Keep button shown while mouse is on toolbar r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D248165
2025-05-22 02:04:27 +00:00
Rob Wu
8753cec273 Bug 1948260 - Reveal hidden Extensions Button in ExtensionControlledPopup r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D248164
2025-05-22 02:04:23 +00:00
Rob Wu
7bf5769658 Bug 1948260 - Ensure Extensions button visibility when PopupNotifications.show() is used r=willdurand
Some doorhangers are anchored to the Extensions Button via
PopupNotifications.show() + gUnifiedExtensions.getPopupAnchorID().

The default behavior of PopupNotifications is to fall back to a
different anchor if the specified anchor is invisible. But if the
Extensions Button is hidden, we want to show it as needed, instead of
triggering the fallback.

This patch reveals the Extensions Button when PopupNotifications is
about to show the panel. This button will automatically be hidden
when the doorhanger is closed, as verified by the tests.

Differential Revision: https://phabricator.services.mozilla.com/D248163
2025-05-22 02:04:19 +00:00
Rob Wu
da9a9a8b6f Bug 1948263 - Change "Add-ons and Themes" to "Extensions and Themes" r=willdurand,fluent-reviewers,bolsson
This change is made for the following reasons:

- Similarity between new "Extensions" menu item, which shows up instead
  of "Extensions and Themes" when the Extensions Button is hidden.
- Consistency with about:preferences, which shows "Extensions & Themes"
  (this was introduced in bug 1483335 and was not touched when the menu
  labels were renamed in bug 1698931).
- Consistency with mobile (bug 1885561)

This effectively reverts the rename of bug 1698931.

Differential Revision: https://phabricator.services.mozilla.com/D248162
2025-05-20 09:56:36 +00:00
Rob Wu
11bb0674a4 Bug 1948263 - Add Extensions appmenu item if needed r=willdurand,fluent-reviewers,bolsson,Gijs
By default, this patch does not change any behavior.
Only when the Extensions Button is hidden, then this replaces the
current generic "Add-ons and Themes" option with the "Extensions"
menu, which opens the Extensions Panel.

Differential Revision: https://phabricator.services.mozilla.com/D248161
2025-05-20 09:56:32 +00:00
Rob Wu
1b1787bc0b Bug 1948263 - Show "Moved to menu" notification after hiding r=willdurand,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D248160
2025-05-20 09:56:29 +00:00
Rob Wu
67ea63720e Bug 1948259 - Allow user to unhide the button via context menu r=willdurand
Allow the user to unhide the hidden button via a context menu item on
the button, in case they do not know about the Customize Toolbar option.

The context menu can be used on the "hidden button" because there are
some situations where the button is temporarily unhidden.

Differential Revision: https://phabricator.services.mozilla.com/D248159
2025-05-20 09:56:25 +00:00
Rob Wu
1dda631789 Bug 1948259 - Add menu item to hide/show Extensions Button in Customize mode r=willdurand,fluent-reviewers,bolsson
Bug 1948258 added a way to hide the Extensions Button, but not a way to
show it. This patch makes the following changes:

- always show the Extensions button in Customization mode, even if the
  user wants to hide the button unconditionally.

- add menu item to toggle the visibility of the Extensions Button.

- the new menu item is not shown anywhere except on the Extensions
  Button in Customization mode.

Differential Revision: https://phabricator.services.mozilla.com/D248158
2025-05-20 09:56:21 +00:00
Mark Banner
8a3c99b9cb Bug 1966662 - Migrate most of toolkit/components/search to moz-src uris. r=search-reviewers,scunnane
Differential Revision: https://phabricator.services.mozilla.com/D249563
2025-05-17 17:38:49 +00:00
Rob Wu
187993ede6 Bug 1948258 - Unhide button when (browserAction) panel opens r=willdurand
This is the basis for the follow-up patches to unhide the button as
needed. In this patch specifically, the hidden button is shown when a
browserAction panel is opened, and hidden again when the panel closes.

This also includes test coverage for ensuring that the browserAction
panel is shown along with the button when needed.

Differential Revision: https://phabricator.services.mozilla.com/D248157
2025-05-16 12:55:28 +00:00
Rob Wu
4f6f7c1712 Bug 1948258 - Allow Extensions button to be hidden via "Remove from Toolbar" r=willdurand
This adds the ability to hide the Extensions button via the standard
"Remove from Toolbar" menu item. The option is behind a temporary hidden
pref, until the follow-up work completes, as elaborated at
https://bugzilla.mozilla.org/show_bug.cgi?id=1948258#c1

Differential Revision: https://phabricator.services.mozilla.com/D248156
2025-05-16 12:55:25 +00:00
Rob Wu
8bc6e28aa7 Bug 1948258 - Add pref that enables the button to be hidden r=willdurand
This pref will be used as the mechanism to store the users preference
for the desired visibility of the Extensions Button. This initial patch
hides the button based on the pref only, and follow-up patches will
adjust the conditions (show the button independently of the pref) and
add UI to toggle this pref.

Differential Revision: https://phabricator.services.mozilla.com/D248155
2025-05-16 12:55:21 +00:00
Rob Wu
3d29b9c917 Bug 1966823 - Ignore rejection from "onMoveToNewWindow" in browser_ext_tabGroups_move.js r=rpl
This is a known source of intermittent failures (bug 1938594).
Analysis in https://bugzilla.mozilla.org/show_bug.cgi?id=1966823#c3

Differential Revision: https://phabricator.services.mozilla.com/D249744
2025-05-16 11:23:44 +00:00
Rob Wu
040f148464 Bug 1966617 - Partial tabGroups.move fix + test coverage r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D249561
2025-05-16 00:39:22 +00:00
Rob Wu
c6223d7101 Bug 1963825 - tabGroups.move index = desired final index r=zombie,tabbrowser-reviewers,dao
To ensure that a group ends up at the position specified by `index`,
this patch adjusts the index when the tab group moves to the right.
Before this patch, the tab group appeared at a too low (left) index
because the original logic did not account for tabs shifting after a
repositioning to the right.

This also introduces stricter validation for moving tabs near pinned
tabs or other tab groups. Previously, the tabbrowser internals adjusted
the index as needed to fit adjacent to pinned tabs or groups. Now, the
extension API throws an error.

The new behavior matches developer expectations and Chrome's behavior:
https://bugzilla.mozilla.org/show_bug.cgi?id=1963825#c9

Differential Revision: https://phabricator.services.mozilla.com/D249493
2025-05-16 00:39:18 +00:00
agoloman
4b62de7961 Revert "Bug 1965343 - Adopt whole tab group at once in replaceGroupWithWindow r=tabbrowser-reviewers,sthompson" for causing bc failures @browser_tab_groups.js.
This reverts commit fac3f86e95.
2025-05-15 18:42:30 +00:00
Rob Wu
fac3f86e95 Bug 1965343 - Adopt whole tab group at once in replaceGroupWithWindow r=tabbrowser-reviewers,sthompson
The `replaceGroupWithWindow` method currently adopts a tab group in
multiple steps, asynchronously. This can result in externally observable
inconsistencies past initial adoption (see bug).

To fix this, this patch changes the adoption logic by passing the tab
group as the initial item to adopt, and adopts the whole group at once
as needed. Now the logic is similar to drag and drop adoption as
implemented in bug 1908441.

Since tabToAdopt is no longer just a tab, but also a tab group (or even
a tab group label since bug 1908441), the logic in ext-browser.js needs
to be adjusted to make sure that it does not mistake non-tab elements
for tabs. Test coverage is in browser_ext_tabGroups_move_onMoved.js,
as not changing that caused the test to fail with:

> FAIL Tab did indeed move to the new window - {"oldWindowId":3,"oldPosition":"undefined"} deepEqual {"oldWindowId":3,"oldPosition":1} -

Differential Revision: https://phabricator.services.mozilla.com/D248537
2025-05-15 13:35:45 +00:00
Rob Wu
525d45a292 Bug 1965007 - Fire tabGroups.onRemoved when window is closing r=zombie
Also add a new removeInfo option to the onRemoved event, with the
isWindowClosing property. This is comparable to the removeInfo parameter
in the tabs.onRemoved event, in case extensions want to special-case the
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D249112
2025-05-14 21:19:29 +00:00
Rob Wu
94716102d0 Bug 1963830 - Reverse TabMove / tabs.onMoved when moving tab groups forwards r=tabbrowser-reviewers,dao
To allow extensions to correctly mirror the positions of tabs that were
bulk-moved by moving a tab group, emit the TabMove event in the reverse
order if the tab group moves forwards. This ensures that the previously
recorded index of a tab before the bulk-move remains valid.

Differential Revision: https://phabricator.services.mozilla.com/D248995
2025-05-14 16:04:08 +00:00
Valentin Gosu
58db94290b Bug 1948543 - Do not use file extension when sniffing mime type r=necko-reviewers,willdurand,kershaw,devtools-reviewers,bomsy,geckoview-reviewers,nalexander
This patch adds a network.sniff.use_extension pref.
When false, the file extension of a URL will only be used to sniff file://

Differential Revision: https://phabricator.services.mozilla.com/D246585
2025-05-13 10:34:58 +00:00
Atila Butkovits
6677b18a72 Revert "Bug 1948543 - Do not use file extension when sniffing mime type r=necko-reviewers,willdurand,kershaw,devtools-reviewers,bomsy,geckoview-reviewers,nalexander" for causing bustages at IndexOutOfBoundsException.
This reverts commit 5eef155802.
2025-05-13 02:30:01 +00:00
Valentin Gosu
5eef155802 Bug 1948543 - Do not use file extension when sniffing mime type r=necko-reviewers,willdurand,kershaw,devtools-reviewers,bomsy,geckoview-reviewers,nalexander
This patch adds a network.sniff.use_extension pref.
When false, the file extension of a URL will only be used to sniff file://

Differential Revision: https://phabricator.services.mozilla.com/D246585
2025-05-13 01:48:28 +00:00
Rob Wu
c2fb04ffe8 Bug 1965714 - Drop optional from queryInfo in tabGroups.query() r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D248716
2025-05-12 02:20:24 +00:00
Rob Wu
e7af560fb9 Bug 1965057 - Set isAdoptingGroup in replaceGroupWithWindow r=tabbrowser-reviewers,sthompson
The tabGroups.onRemoved / onCreated / onMoved event depends on the
isAdoptingGroup / removedByAdoption flags to identify tab groups that are
adopted by another window. Although this flag is set for the
`gBrowser.adoptTabGroup` method, it is not in the
`gBrowser.replaceGroupWithWindow` method, which results in incorrect
events.

This patch fixes the issue by setting the isAdoptingGroup flag in
`gBrowser.replaceGroupWithWindow`.

Differential Revision: https://phabricator.services.mozilla.com/D248327
2025-05-08 23:36:16 +00:00
Rob Wu
eafe92dd52 Bug 1965083 - Add private browsing checks to tabGroups events r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D248441
2025-05-08 18:05:28 +00:00
Sandor Molnar
793b19de78 Revert "Bug 1948543 - Do not use file extension when sniffing mime type r=necko-reviewers,willdurand,kershaw,devtools-reviewers,bomsy" for causing android gv-junit failures.
This reverts commit f1a97648e9.
2025-05-07 14:55:56 +00:00
Valentin Gosu
f1a97648e9 Bug 1948543 - Do not use file extension when sniffing mime type r=necko-reviewers,willdurand,kershaw,devtools-reviewers,bomsy
This patch adds a network.sniff.use_extension pref.
When false, the file extension of a URL will only be used to sniff file://

Differential Revision: https://phabricator.services.mozilla.com/D246585
2025-05-07 12:21:40 +00:00
Cristina Horotan
9e3f67048c Revert "Bug 1948543 - Do not use file extension when sniffing mime type r=necko-reviewers,willdurand,kershaw" for causing dt failures at 7f63794d20
This reverts commit 7f63794d20.
2025-05-07 00:39:21 +00:00
Valentin Gosu
7f63794d20 Bug 1948543 - Do not use file extension when sniffing mime type r=necko-reviewers,willdurand,kershaw
This patch adds a network.sniff.use_extension pref.
When false, the file extension of a URL will only be used to sniff file://

Differential Revision: https://phabricator.services.mozilla.com/D246585
2025-05-06 23:08:50 +00:00
William Durand
7ca91393b3 Bug 1956488 - Add sections to the add-on install/update/optional prompts. r=rpl,fluent-reviewers,desktop-theme-reviewers,dao,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D247088
2025-05-06 14:03:24 +00:00
Rob Wu
2f6ff59ac1 Bug 1962683 - Avoid missed event in browser_ext_tabs_group_ungroup.js r=zombie
This patch moves the tabs API calls after the tabGroups event call,
which increases the likelihood that the tabGroups implementation loads
(with the event registered) before tabs.group() is called, to address
https://bugzilla.mozilla.org/show_bug.cgi?id=1962683#c3

Differential Revision: https://phabricator.services.mozilla.com/D246779
2025-04-29 18:23:26 +00:00
Norisz Fay
af318eba45 Backed out changeset f03d4b22573f (bug 1962683) for causing mochitest failures on browser_ext_tabs_group_ungroup.js CLOSED TREE 2025-04-29 17:16:13 +03:00
Rob Wu
e6e595260e Bug 1962683 - Avoid missed event in browser_ext_tabs_group_ungroup.js r=zombie
This patch moves the tabs API calls after the tabGroups event call,
which increases the likelihood that the tabGroups implementation loads
(with the event registered) before tabs.group() is called, to address
https://bugzilla.mozilla.org/show_bug.cgi?id=1962683#c3

Differential Revision: https://phabricator.services.mozilla.com/D246779
2025-04-29 13:14:56 +00:00
Rob Wu
f196bdf30a Bug 1962683 - Temporarily skip intermittently failing test assertion r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D246744
2025-04-25 13:44:46 +00:00
Rob Wu
d808e75edb Bug 1960126 - Split browser_ext_tabs_group_ungroup.js r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D246703
2025-04-25 13:44:46 +00:00
Rob Wu
6521fc35e2 Bug 1962592 - Reduce tab moves in adoptTabGroup r=tabbrowser-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D246702
2025-04-25 13:44:46 +00:00