Commit Graph

4109 Commits

Author SHA1 Message Date
Alex Kontos
666987e4ec refactor: bootstrapped extensions 2025-11-06 14:13:28 +00:00
Alex Kontos
e7824895ad refactor: rename Firefox related references to their relevant counterparts 2025-11-03 16:04:55 +00:00
Alex Kontos
8252e45d0f feat: implement privileged extension support
Also includes:

* feat: improve support for bootstrapped extensions
Added support for custom preference pages.
* fix: incorrect loading order for bootstrap loader
* fix: BootstrapLoader

(cherry picked from commit eb40811e464688c7d2fc58a4330272dde1ec7937)
2025-11-03 16:04:54 +00:00
Rob Wu
3d9b423dd8 Bug 1976773 - Remove mousenter/mouseleave listeners from browser-addons.js a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D258434

Differential Revision: https://phabricator.services.mozilla.com/D260202
2025-08-20 02:01:40 +00:00
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
agoloman
63c83deb26 Revert "Bug 1606785 - Enable Prettier for CSS files r=desktop-theme-reviewers,Standard8,frontend-codestyle-reviewers,emilio" for causing multiple failures.
This reverts commit ec5fa1d4c0.

Revert "Bug 1606785 - Format Firefox CSS files with Prettier r=desktop-theme-reviewers,perftest-reviewers,places-reviewers,translations-reviewers,omc-reviewers,backup-reviewers,browser-installer-reviewers,sparky,dao,pdahiya,nrishel,kpatenio"

This reverts commit baa5d72bbd.

Revert "Bug 1606785 - Format browser/themes and toolkit/themes CSS files with Prettier r=desktop-theme-reviewers,pip-reviewers,tabbrowser-reviewers,places-reviewers,dao,mconley"

This reverts commit 9604b0a8ae.

Revert "Bug 1606785 - Format browser/themes/preferences CSS files with Prettier r=settings-reviewers,desktop-theme-reviewers,dao,mconley"

This reverts commit 686c1cf85f.

Revert "Bug 1606785 - Format urlbar CSS files with Prettier r=urlbar-reviewers,desktop-theme-reviewers,dao"

This reverts commit a7a4f31251.

Revert "Bug 1606785 - Format webcompat CSS files with Prettier r=webcompat-reviewers,denschub"

This reverts commit 41bc4d5237.

Revert "Bug 1606785 - Format search CSS files with Prettier r=search-reviewers,jteow"

This reverts commit 7bb7f82374.

Revert "Bug 1606785 - Format dom CSS files with Prettier r=emilio"

This reverts commit c22e910235.

Revert "Bug 1606785 - Format android CSS files with Prettier r=geckoview-reviewers,hiro"

This reverts commit c08e43fc3d.

Revert "Bug 1606785 - Format layout CSS files with Prettier r=layout-reviewers,dholbert"

This reverts commit 4f2a32d1a4.

Revert "Bug 1606785 - Format devtools CSS files with Prettier r=devtools-reviewers,nchevobbe,frontend-codestyle-reviewers"

This reverts commit c05f675ddf.

Revert "Bug 1606785 - Format recomp CSS files with Prettier r=reusable-components-reviewers,desktop-theme-reviewers,dao,mkennedy"

This reverts commit b10c7de8d0.

Revert "Bug 1606785 - Format sidebar CSS files with Prettier r=sidebar-reviewers,desktop-theme-reviewers,dao,nsharpley"

This reverts commit d32c555e37.

Revert "Bug 1606785 - Format shopping CSS files with Prettier r=shopping-reviewers,desktop-theme-reviewers,dao,rking"

This reverts commit 965887a708.

Revert "Bug 1606785 - Format profiles CSS files with Prettier r=profiles-reviewers,desktop-theme-reviewers,dao,mossop"

This reverts commit 8338860f74.

Revert "Bug 1606785 - Format genai and ml CSS files with Prettier r=firefox-ai-ml-reviewers,Mardak"

This reverts commit d66681f553.

Revert "Bug 1606785 - Format firefoxview CSS files with Prettier r=fxview-reviewers,desktop-theme-reviewers,dao,jsudiaman"

This reverts commit 530b815cad.

Revert "Bug 1606785 - Format aboutlogins, megalist, and form autofill CSS files with Prettier r=credential-management-reviewers,mtigley,desktop-theme-reviewers,dao"

This reverts commit 813c864381.
2025-05-21 04:49:28 +00:00
hannajones
baa5d72bbd Bug 1606785 - Format Firefox CSS files with Prettier r=desktop-theme-reviewers,perftest-reviewers,places-reviewers,translations-reviewers,omc-reviewers,backup-reviewers,browser-installer-reviewers,sparky,dao,pdahiya,nrishel,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D249182
2025-05-21 03:55:13 +00:00
Dão Gottwald
e0a00e5f7d Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D249783
2025-05-20 12:06:21 +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
Sandor Molnar
32b4815cfe Revert "Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker" for causing remote failures @ browser_TabManager.js
This reverts commit 38a0034022.
2025-05-19 21:07:58 +00:00
Dão Gottwald
38a0034022 Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D249783
2025-05-19 19:48:54 +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
Dão Gottwald
0007fe7bd1 Bug 1966617 - Make adoptTabGroup support both elementIndex and tabIndex, and stop converting tab indices to element indices. r=robwu,sthompson,tabbrowser-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D249619
2025-05-16 00:39:26 +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
Emilio Cobos Álvarez
02216609fd Bug 1965660 - Remove unneeded ::-moz-focus-inner usage from the front-end. r=devtools-reviewers,webcompat-reviewers,twisniewski,nchevobbe
These became unneeded either when:

 * We shipped the non-native theme (for newtab etc).
 * We made unthemed buttons not show this inner ring.

Differential Revision: https://phabricator.services.mozilla.com/D248698
2025-05-12 15:18:37 +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