Commit Graph

4061 Commits

Author SHA1 Message Date
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
Rob Wu
38b9ddf35c Bug 1963616 - Don't try adding action context menus without permission r=willdurand
When an extension does not have the contextMenus or menus permission,
it is not possible to have extension-defined context menus on an
extension's action button. The actionContextMenu() call would never
add menu items in this case.

As the bug report shows, trying to call actionContextMenu() can throw
an error when the ext-menus.js module has not been loaded. To avoid
this error, verify that the extension has the permission to add menus.

Because ext-menus.js is declared with `"events": ["startup"]`, the
module is guaranteed to be loaded if an extension has the permissions.

Differential Revision: https://phabricator.services.mozilla.com/D248154
2025-05-07 23:27:01 +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
Jeremy Swinarton
186b5eaa63 Bug 1964152: Dispatch TabGrouped and TabUngrouped from the tab group, not the tab r=dao,sthompson,tabbrowser-reviewers,zombie
Differential Revision: https://phabricator.services.mozilla.com/D247660
2025-05-06 15:43:04 +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
Rob Wu
6899ed5a68 Bug 1962592 - Avoid unnecessary tabs.onMoved when moving tab groups r=zombie
This patch covers multiple cases:

- Pre-existing issue: adoptTabGroup adopts tabs by first moving the tabs
  elsewhere, then moving it into a group. When moved into a group,
  TabMove is fired, which previously translated to tabs.onMoved. That
  would result in too much event noise.

- When tabGroups.move is called, it first adopted the tab group in
  another window, and then moved the tab group as a whole. This
  results in unnecessary tabs.onMoved events too. The fix is to specify
  the desired position at once to adoptTabGroup.

Differential Revision: https://phabricator.services.mozilla.com/D246701
2025-04-25 13:44:46 +00:00
Rob Wu
cbf77f8d55 Bug 1962475 - Do not fire tabGroups.onRemoved and onCreated when moving across windows r=zombie,tabbrowser-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D246688
2025-04-25 13:44:45 +00:00
zombie
57343ff9a1 Bug 1962127 - Split tabGroups_move_onMoved to a separate test r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D246696
2025-04-25 13:44:45 +00:00
zombie
4bcea23706 Bug 1962127 - Implement tabGroups.query r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D246658
2025-04-25 13:44:45 +00:00
zombie
60be587fd4 Bug 1961663 - Implement tabGroups.onCreated and onRemoved r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D246529
2025-04-25 13:44:45 +00:00
zombie
7063143eaf Bug 1961660 - Implement tabGroups.move and onMoved r=robwu,tabbrowser-reviewers,dwalker,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D246378
2025-04-25 13:44:44 +00:00
zombie
0f0180e660 Bug 1961657 - Implement tabGroups.update and onUpdated r=robwu,tabbrowser-reviewers,dwalker,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D246164
2025-04-25 13:44:44 +00:00
zombie
bdc8557b9e Bug 1961539 - Introduce tabGroups, implement tabGroups.get r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D246120
2025-04-25 13:44:44 +00:00
Joel Maher
397e8ec3f4 Bug 1961608 - Green up macosx 15.30. r=aryx,necko-reviewers,extension-reviewers,media-playback-reviewers,credential-management-reviewers,sync-reviewers,anti-tracking-reviewers,sessionstore-reviewers,places-reviewers,omc-reviewers,profiles-reviewers,pdahiya,alwu,jhirsch,mtigley,skhamis,timhuang,valentin,robwu,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D246100
2025-04-22 18:12:28 +00:00
Stephanie Cunnane
8a13f6721b Bug 1961038 - Consistently use "changeReason" rather than "changeSource" in code related to search.engine.default.changed Glean event telemetry. r=search-reviewers,jteow
Differential Revision: https://phabricator.services.mozilla.com/D245820
2025-04-17 21:19:43 +00:00
Joel Maher
986c1b9cc2 Bug 1959265 - clean and sanitize browser/**/xpcshell.toml files. r=aryx,credential-management-reviewers,search-reviewers,sessionstore-reviewers,places-reviewers,omc-reviewers,migration-reviewers,backup-reviewers,home-newtab-reviewers,urlbar-reviewers,firefox-ai-ml-reviewers,profiles-reviewers,willdurand,tarek,dimi,jteow,sthompson,mconley,pdahiya,mossop
Differential Revision: https://phabricator.services.mozilla.com/D244829
2025-04-17 18:30:44 +00:00
William Durand
9088de1e2d Bug 1954525 - Add support for data collection permissions in browser.permissions.request(). r=rpl,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D244817
2025-04-15 16:22:22 +00:00
Rob Wu
d1ae025d4a Bug 1959716 - Support groupId in tabs.onUpdated (desktop only) r=zombie,dao
Note: only implemented in desktop Firefox. On mobile, the tab groups
feature does not exist, so tabs.onUpdated would never fire. The
mobile-specific tabs.json schema does not declare "properties" filter
either, so there is no place to list the "groupId" filter either.

Differential Revision: https://phabricator.services.mozilla.com/D245264
2025-04-11 23:07:16 +00:00
Rob Wu
3e9aa82468 Bug 1959714 - Implement tabs.group() and tabs.ungroup() r=zombie,dao,frontend-codestyle-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245249
2025-04-11 23:07:15 +00:00
Rob Wu
05a677bb1f Bug 1959715 - Support groupId in tabs.query r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D245160
2025-04-11 23:07:15 +00:00
Rob Wu
2004e55a76 Bug 1959713 - Expose tabs.Tab.groupId r=zombie,dao,tabbrowser-reviewers,frontend-codestyle-reviewers
This patch exposes a groupId field on tabs.Tab objects in extensions.

On mobile (Android), the value is always -1.

On desktop, the value is the numeric representation composed from the
internal ID, which happens to fit in a safe integer. As long as the
browser is not running past year 2255, this works. As a fallback,
when an ID in a different format is encountered, the logic falls back
to returning a new unique ID based on a counter. This ID is then
stored in an internal in-memory map to maintain stable consistency.
Since it is unclear when exactly it is safe to discard this value, this
map is never cleared. This minor memory leak is acceptable because it
does not happen in practice, and even if it does, the number of tab
groups over the lifetime of a Firefox session is not going to reach
excessive values.

Differential Revision: https://phabricator.services.mozilla.com/D245159
2025-04-11 23:07:15 +00:00
Stephen Thompson
f2e07044ae Bug 1938424 - metrics event when tabs added to tab group r=dao,jswinarton,tabbrowser-reviewers,extension-reviewers,robwu
When using the tab context menu or drag-dropping tabs to put them into a group, record a metric for the number of tabs added to the group.

Data Science asked us to launch with this metric disabled so that they could control it using server knobs. They expect a high volume of events, so they expect to only enable this metric for some proportion of users.

I converted the existing `TabMove` event derived from `UIEvent` being fired when tabs change their tab index in the tab strip. `UIEvent` doesn't allow for attaching additional context/detail to the event. `TabMove` is now a `CustomEvent` that provides more context about the moved tab and it fires in more cases -- it's possible for the tab index not to change despite the tab having "moved" into/out of a tab group.

This approach would not capture tab movements that occur across multiple frames/event loop iterations.

Differential Revision: https://phabricator.services.mozilla.com/D244616
2025-04-11 13:52:22 +00:00
Gregory Pappas
2c1c232662 Bug 1959061 - Remove overflow/underflow event prefs r=extension-reviewers,emilio,robwu
And use counters

Differential Revision: https://phabricator.services.mozilla.com/D244718
2025-04-08 23:48:03 +00:00
Goloman Adrian
dbfe2fbd57 Backed out changeset 8df80a696c61 (bug 1959061) for causing multiple failures. CLOSED TREE 2025-04-08 17:20:57 +03:00
Gregory Pappas
822da8e785 Bug 1959061 - Remove overflow/underflow event prefs r=extension-reviewers,emilio,robwu
And use counters

Differential Revision: https://phabricator.services.mozilla.com/D244718
2025-04-08 13:22:30 +00:00
Cosmin Sabou
51285c4191 Backed out changeset 65d8bcd98b49 (bug 1959061) for causing build bustages on ScrollContainerFrame. CLOSED TREE 2025-04-08 16:11:10 +03:00
Gregory Pappas
da085e844a Bug 1959061 - Remove overflow/underflow event prefs r=extension-reviewers,emilio,robwu
And use counters

Differential Revision: https://phabricator.services.mozilla.com/D244718
2025-04-08 12:22:39 +00:00
Emilio Cobos Álvarez
67622dd14f Bug 1956758 - Fix a typo in a test.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2025-04-04 13:54:42 +02:00
Emilio Cobos Álvarez
c5bf0c134a Bug 1956758 - Expose whether we use a "native" menubar at runtime. r=stransky,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D243431
2025-04-04 09:16:33 +00:00
Luca Greco
31e6a83040 Bug 1935135 - Add requestLongerTimeout to browser_ext_browserAction_context.js. r=willdurand
The TV job failures hit so far seems to be both due to the per-testfile timeout being reached before all tasks
in this test file got a chance to run, and in both cases it was hit in chaos mode and on macOS build.

This patch adds a requestLongerTimeout call to increase the per-testfile timeout, which should give the test file
enough time for passing the TV job even when in macOS builds and chaos mode it may be taking slighly longer.

Differential Revision: https://phabricator.services.mozilla.com/D231423
2025-04-01 12:00:18 +00:00
William Durand
22e82b9c44 Bug 1957087 - Update add-on install/update prompt. r=rpl,desktop-theme-reviewers,Itiel
Differential Revision: https://phabricator.services.mozilla.com/D243455
2025-04-01 11:50:44 +00:00
Dão Gottwald
3ba48b6655 Bug 1950904 - Use element index instead of tab index for the drop indicator. r=dwalker,jswinarton,tabbrowser-reviewers,perftest-reviewers,fbilt
Differential Revision: https://phabricator.services.mozilla.com/D239937
2025-03-19 15:07:53 +00:00
erosman
c317879254 Bug 1951166 - Allow page_action as context menu type in MV3 r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D240376
2025-03-05 10:35:44 +00:00
Mark Banner
878a5d5415 Bug 1951652 - Convert browser/components/search/ modules to use moz-src uris. r=search-reviewers,scunnane
Differential Revision: https://phabricator.services.mozilla.com/D240333
2025-03-05 09:24:37 +00:00
William Durand
c8b7fe3ad9 Bug 1659500 - Disable contextualIdentities API on GeckoView builds. r=robwu
Depends on D240002

Differential Revision: https://phabricator.services.mozilla.com/D238525
2025-03-03 14:14:38 +00:00
Gijs Kruitbosch
dcb8be8cff Bug 1950871 - switch browser/components/tabbrowser to use moz-src, r=dao,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D239926
2025-03-03 12:47:49 +00:00
Andrea Marchesini
c1c6a9d919 Bug 1917847 - Remove "extensions.ui.installDialogFullDomains" pref, r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D236687
2025-03-03 08:31:43 +00:00
Rob Wu
d5d91000ab Bug 1949946 - Fix typo in pref in browser_ext_canOpenModalPicker.js test r=extension-reviewers,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D239248
2025-02-24 14:08:48 +00:00
Rob Wu
2b9e9d3154 Bug 1949587 - Restore picker behavior for hidden extension pages r=edgar
Since Firefox 136, pickers cannot be opened from non-focused tabs.
Unintentionally, background pages of extensions and devtools pages of
extensions were also affected, because their browsers are embedded in a
hidden XUL window, which is considered not focused.

This patch updates CanonicalBrowsingContext::CanOpenModalPicker to allow
pickers to be opened from specific hidden extension browsers again.

To evaluate the feasibility of enforcing the restriction for hidden
background pages, this patch puts the restriction behind a pref,
enabled by default on Nightly only. If no signs of broken extensions
are reported for a few releases, we can set the pref by default, to
enforce the restriction (and document the change accordingly).
After another few releases we can evaluate whether to enforce the
restriction permanently (effectively removing the exception from
this patch) or to revert the pref.

Differential Revision: https://phabricator.services.mozilla.com/D239046
2025-02-21 19:02:19 +00:00
Joel Maher
6d2e459f55 Bug 1948426 - Carry over annotations from macosx 11.20 to 15.30. r=aryx,pip-reviewers,sessionstore-reviewers,tabbrowser-reviewers,urlbar-reviewers,jteow,nsharpley,mconley
Differential Revision: https://phabricator.services.mozilla.com/D238336
2025-02-20 22:03:44 +00:00