Commit Graph

3156 Commits

Author SHA1 Message Date
Marco Bonardo
6e1c1d304a Bug 1848715 - Untrim address bar value on user interaction. r=dao,tabbrowser-reviewers
Untrim the address bar value when the user starts manipulating it.
This doesn't untrim on focus, because that would break double-click to select
word, and drag-select. In the future we'll evaluate untrim on focus, but we'll
need additional platform support to replicate that functionality.
The behavior is currently controlled by the feature-gate preference
`browser.urlbar.untrimOnUserInteraction.featureGate`.

Original patch by Marc Seibert.

Differential Revision: https://phabricator.services.mozilla.com/D206135
2024-04-24 17:01:48 +00:00
Dale Harvey
5f9ad2e51c Bug 1871206 - Implement secondary actions for the urlbar. r=mak,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D203381
2024-04-23 11:33:33 +00:00
Drew Willcoxon
ea5c333253 Bug 1892732 - Fix the urlbar help command for results that don't define a help URL. r=daleharvey
When UrlbarView [handles the help command for a result](https://searchfox.org/mozilla-central/rev/863aef60f9fa1536884252ad90cad1d8ee9d8a41/browser/components/urlbar/UrlbarView.sys.mjs#3471-3476), first it determines the
result's help URL. If `result.payload.helpUrl` is defined it uses that, and
otherwise it falls back to generating a default help URL. Either way, then it
sets `menuitem.dataset.url` to the help URL and calls `input.pickResult()`.

Before bug 1883378, `pickResult()` would similarly first check
`result.payload.helpUrl` and then fall back to `menuitem.dataset.url` when
determining the help URL to load. Bug 1883378 changed this behavior so that it
only checks `result.payload.helpUrl`. That means we break any provider that
implements the help command but doesn't define a help URL on its results, like
Yelp and MDN.

One way to fix this would be to make sure providers that implement the help
command always define a help URL on their results. I don't like that idea
because it's nice for providers to be able to rely on a default help URL that's
defined elsewhere.

Another fix would be to always use `menuitem.dataset.url` in `pickResult()` and
don't check `result.payload.helpUrl` at all. That would work for result menu
items, but it wouldn't work for other elements like buttons that don't go
through the result-menu-command path. I don't know if we currently have any such
paths but I don't want to break something else.

So instead I think we should just go back to the status quo before bug 1883378:
First check `result.payload.helpUrl` if the command is help, and then fall back
to `menuitem.dataset.url`.

Differential Revision: https://phabricator.services.mozilla.com/D208197
2024-04-22 23:51:24 +00:00
Dão Gottwald
04e7257b55 Bug 1892377 - Prolong urlbar.quick_suggest_contextual_opt_in metric. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D207999
2024-04-19 15:15:38 +00:00
Daisuke Akatsuka
da00b8a3de Bug 1891602: Remove telemetries that are no longer in use r=adw
Differential Revision: https://phabricator.services.mozilla.com/D207514
2024-04-17 08:54:56 +00:00
Daisuke Akatsuka
a12822f81a Bug 1891602: Use manage menu item for general quick suggestion r=adw
Differential Revision: https://phabricator.services.mozilla.com/D207513
2024-04-17 08:54:56 +00:00
Yi Xiong Wong
03a2372d77 Bug 1880914 - Move BrowserOpenAddonsMgr. r=Gijs,extension-reviewers,settings-reviewers,firefox-desktop-core-reviewers ,home-newtab-reviewers,robwu,thecount
Differential Revision: https://phabricator.services.mozilla.com/D207110
2024-04-15 10:22:46 +00:00
Karandeep
d8690f18b5 Bug 1888908 - Rename current onEngagement to onLegacyEngagement r=mak
Differential Revision: https://phabricator.services.mozilla.com/D206251
2024-04-09 13:07:23 +00:00
Daisuke Akatsuka
c6bfe80f01 Bug 1889820: Add isManageable attribute to show 'Manage' result menu item in a suggestion r=adw
Differential Revision: https://phabricator.services.mozilla.com/D206862
2024-04-09 07:41:52 +00:00
Daisuke Akatsuka
a36b7e1259 Bug 1889820: Add 'Manage' result menu item for quick suggest features having own menu r=adw
Differential Revision: https://phabricator.services.mozilla.com/D206861
2024-04-09 07:41:52 +00:00
Marco Bonardo
ba6b343c0c Bug 1889894 - Change UlrbarInput::_setValue options to an object. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D206767
2024-04-08 14:52:51 +00:00
Marco Bonardo
3859f736e6 Bug 1888688 - Add address bar test for less common selection manipulations. r=dao
Preparatory test to cover some not-well tested selection manipulations in the
Address Bar, as we're about to test different kind of trimming behaviors.

Differential Revision: https://phabricator.services.mozilla.com/D206134
2024-04-08 14:25:05 +00:00
Mark Banner
6699dcb7f8 Bug 1799465 - Enable require-jsdoc rules by default, disabling on code where there are existing failures. r=frontend-codestyle-reviewers,migration-reviewers,backup-reviewers,mossop,mconley
Differential Revision: https://phabricator.services.mozilla.com/D206878
2024-04-08 13:34:13 +00:00
Drew Willcoxon
3256a9b33b Bug 1890079 - Make the yelpMinKeywordLength Nimbus variable more useful. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D206834
2024-04-08 04:40:01 +00:00
Dale Harvey
3394af4940 Bug 1886140 - Fix undefined queryContext in paste-and-go. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D206202
2024-04-07 17:32:02 +00:00
Karandeep
d36112e266 Bug 1888905 - Remove the start and discard notifications. r=mak,adw
Differential Revision: https://phabricator.services.mozilla.com/D206238
2024-04-05 16:15:08 +00:00
Norisz Fay
f8ee70f7ac Backed out changeset 519aa7ff2ca6 (bug 1888905) for causing bc failures on browser_glean_telemetry_reenter.js CLOSED TREE 2024-04-04 18:37:26 +03:00
Karandeep
059ef5ae44 Bug 1888905 - Remove the start and discard notifications. r=mak,adw
Differential Revision: https://phabricator.services.mozilla.com/D206238
2024-04-04 14:06:23 +00:00
Emilio Cobos Álvarez
9eb098cd7c Bug 1889463 - Prevent flickering with the previous patch. r=dao,desktop-theme-reviewers
The toolbar height includes the top border now. It's not what we want
anyways:

 * In some cases its usage was completely redundant (we can use the
   default static position).

 * In other cases what we want is the urlbar-container height, which
   doesn't include that border. I confirmed this looks good in compact
   mode (which was the reason for introducing this in bug 1580248).

So simplify the code a tiny bit and fix the flickering that got the
original version reverted.

Differential Revision: https://phabricator.services.mozilla.com/D206596
2024-04-04 10:21:27 +00:00
Drew Willcoxon
0c993cb63d Bug 1881875 - Add telemetry for potential suggestion impressions in the urlbar. r=mak
This includes some unrelated changes that lint either made or complained about.

Depends on D206110

Differential Revision: https://phabricator.services.mozilla.com/D206173
2024-04-03 22:02:07 +00:00
Joel Maher
a1c9f109b8 Bug 1889412 - skip 25+ minute manifests on asan/tsan. r=aryx,extension-reviewers,settings-reviewers,robwu
Differential Revision: https://phabricator.services.mozilla.com/D206512
2024-04-03 17:46:29 +00:00
Drew Willcoxon
c081ab3694 Bug 1889154 - Fix an intermittent timeout in browser_quicksuggest_pocket.js and modify it to test the Rust backend. r=daisuke
Like a lot of the other Suggest tests, this Pocket one seems to have
intermittent timeouts simply due to the test taking too long, despite the fact
that the test isn't very long. I'm not sure why. I have more comments about it
in bug 1888594 and D206263.

While I was here, I also updated this test so it uses `add_tasks_with_rust()` so
it tests the Rust backend too. The comment that I removed refers to errors that
happened when I tried that before, but we must have fixed them because it works
fine now.

Differential Revision: https://phabricator.services.mozilla.com/D206442
2024-04-03 15:54:03 +00:00
Drew Willcoxon
e8d7d14f6d Bug 1888594 - Fix browser_quicksuggest_mdn.js intermittent timeouts. r=daisuke
There seem to be two problems:

1. The test loads a long URL in the browser test's default tab, which can cause
   the test to hang for a few seconds at the end. I think this might be the
   cause of intermittent non-verify-mode timeouts. Please see the bug for
   details. To fix this, I modified the test to load the long URL in a new tab.
2. Even with the first problem fixed, the test takes forever in chaos mode in
   verify mode on Mac. I don't know why, this test isn't really doing much. To
   fix this, I added a `requestLongerTimeout()`. I don't know if it's as slow on
   other platforms. My hunch is that it has something to do with all the
   communication Firefox does with the mock RemoteSettingsServer during the
   test. When you watch the test run, you can see the RemoteSettingsServer log
   its output very slowly. Also, other Suggest tests seem to have this problem
   too because over time we've added similar `requestLongerTimeout()` calls to
   a bunch of them.

Differential Revision: https://phabricator.services.mozilla.com/D206263
2024-04-03 15:54:02 +00:00
Yi Xiong Wong
e26b29eb0a Bug 1880914 - Move BrowserStop. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D206102
2024-04-03 10:32:27 +00:00
Yi Xiong Wong
3df27d805a Bug 1880914 - Move BrowserOpenTab. r=Gijs,webdriver-reviewers,perftest-reviewers,extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,home-newtab-reviewers,thecount,whimboo,dao,afinder,omc-reviewers,aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D205529
2024-04-03 10:32:27 +00:00
Marco Bonardo
fc1eaef54c Bug 1888627 - Avoid Address Bar engagement telemetry record() re-entrance. r=adw
If a provider onEngagement method causes the address bar panel to close when
a result is picked, we may record consecutive engagement and abandonment events
for the same search session.

Differential Revision: https://phabricator.services.mozilla.com/D206110
2024-04-02 16:34:30 +00:00
Drew Willcoxon
02f24574f9 Bug 1887711 - Remove merino_adm_nonsponsored from urlbar metrics.yaml docs. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D205884
2024-03-28 16:21:07 +00:00
Karandeep
495cc74adb Bug 1884094 - Bookmarks, Tabs and History suggestions are displayed in Address Bar if user has a clipboard entry saved. r=mak
Fixed clipboard provider to stop running when address bar is in search mode.
This allows the Bookmarks, Tabs and History suggestions to be displayed
when in seach mode and a clipboard entry saved.

Differential Revision: https://phabricator.services.mozilla.com/D204288
2024-03-22 20:23:49 +00:00
Drew Willcoxon
a17188bd2b Bug 1886175 - Properly count urlbar hidden exposures whose hypothetical rows can't immediately be shown. r=mak,wstuckey
The problem has to do with hidden exposures whose hypothetical rows can't
immediately be made visible either because they would overflow the filled-up
view or because a misplaced result was seen.

The relevant part of `#updateResults()` is [here](https://searchfox.org/mozilla-central/rev/6a2a2a52d7e544a2fd5678d04991a7e78b694f22/browser/components/urlbar/UrlbarView.sys.mjs#1289-1291). When `canBeVisible` is false,
we effectively forget about that hidden-exposure result, which is not right. For
normal results, we also have that `canBeVisible` logic (a few lines down from
the part I linked), but the difference is that we create a hidden row for them
and then unhide the row when the query finishes and stale rows are removed.
We're missing an analog to that logic for hidden-exposure results, so we're
undercounting them.

Fortunately it's not too hard to fix. I added a new kind of exposure for
`TelemetryEvent` to track called "tentative" exposures. Tentative exposures are
entirely analogous to this case where a row would be added but hidden, and then
unhidden when stale rows are removed.

While I was modifying the test, I rephrased the comments for existing tasks so
hopefully they're easier to understand.

Differential Revision: https://phabricator.services.mozilla.com/D205155
2024-03-21 16:50:47 +00:00
Daisuke Akatsuka
a1930be19e Bug 1882967: Create icon image by its blob and mimetype r=adw
Differential Revision: https://phabricator.services.mozilla.com/D203237
2024-03-21 10:26:53 +00:00
Dave Townsend
f528bb5e79 Bug 1864896: Fix more unused arguments in browser and toolkit. r=mconley,webcompat-reviewers,places-reviewers,Standard8,denschub,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D205193
2024-03-21 08:35:36 +00:00
Mark Banner
f54a4f10f3 Bug 1885723 - Fix more jsm references in urlbar/tests/. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D204846
2024-03-20 10:05:00 +00:00
Emilio Cobos Álvarez
1c20c25eda Bug 232598 - Return null for unset attributes in XUL. r=smaug,devtools-reviewers,omc-reviewers,zombie,nchevobbe,settings-reviewers,application-update-reviewers,credential-management-reviewers,mossop,aminomancer,bytesized,issammani,sessionstore-reviewers,dao
I just got bit by this in bug 1873833, let's just fix it. There isn't
all that much stuff depending on it anymore.

Differential Revision: https://phabricator.services.mozilla.com/D204496
2024-03-18 09:15:07 +00:00
Marco Bonardo
317e4002ac Bug 1884146 - Cross containers switch-tab artifacts remain on other address bar results. r=jteow
The heuristic result is always kept first when receiving new results, that means
any result could be upgraded to be a heuristic result, including the first Top
Site, as in the zero prefix case there's no heuritic.
Thus it's safer to generate new DOM contents when upgrading between heuristic and
non-heuristic.

Also switch-tab results with container info have complex structure and should
generate new DOM contents, unless they are reused by other switch-tab results.

Unfortunately these changes are mostly visual and not easily testable, as it would
be very time consuming.

In general, for the long term, reusing the DOM of results is fragile and causes
nodes, attributes or classes to be ported over to incompatible results. We do it
to avoid flicker, but we must investigate better ways to do it.

Differential Revision: https://phabricator.services.mozilla.com/D204483
2024-03-15 10:18:25 +00:00
Drew Willcoxon
06fb4d6c05 Bug 1884854 - Simplify urlbar weather fetching and improve add_tasks_with_rust(). r=daisuke
This simplifies weather fetching so that multiple fetches are queued up instead
of hitting Merino at the same time. The newest fetch will cause earlier fetches
to stop (when possible). This is similar to how `SuggestBackendRust` handles
ingest.

This also improves `add_tasks_with_rust()` in a couple ways: (1) It adds
`skip_if_rust_enabled` and (2) handles task function args better by cloning them
instead of reusing them in the `_rustEnabled` and `_rustDisabled` tasks.

Currently we're relying on the normal xpcshell `skip_if` predicate to skip
`_rustEnabled` tasks when Rust is enabled while still running their
`_rustDisabled` counterparts when Rust is disabled. Except it doesn't work at
all because the `skip_if` predicate is evaluated at the time `add_task()` is
called, not when its task runs. That means the `_rustDisabled` versions of these
tasks are never run, since Rust is now enabled by default. So we're missing test
coverage in these cases. It's not a huge problem since hopefully we will not go
back to enabling the JS backend by default, but until we remove the JS backend,
we should maintain test coverage. (The `setupAndTeardown()` task in
`test_quicksuggest.js` failed when I fixed this, so that's once case where we
had a failing task and didn't know about it.)

Depends on D204138

Differential Revision: https://phabricator.services.mozilla.com/D204325
2024-03-14 04:23:46 +00:00
Gijs Kruitbosch
75f6d4f624 Bug 1885189 - remove some test-only uses of prompts.contentPromptSubDialog, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204533
2024-03-13 22:19:58 +00:00
Mark Banner
db1c82325d Bug 1885121 - Fix a few more tests that are broken with search-config-v2 enabled. r=mcheang
Differential Revision: https://phabricator.services.mozilla.com/D204500
2024-03-13 14:51:07 +00:00
Mark Banner
f65518c3c0 Bug 1882577 - Make nsISearchEngine.getIconURL an async function. r=search-reviewers,extension-reviewers,settings-reviewers,robwu,mcheang,mak
Differential Revision: https://phabricator.services.mozilla.com/D203026
2024-03-13 14:51:06 +00:00
Karandeep
9af5d8493e Bug 1880498 - Modify the abandonment event, to also happen in case of a switch tab. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D202238
2024-03-13 14:08:06 +00:00
Drew Willcoxon
34f1979f9a Bug 1832912 - Fix failures in urlbar weather tests. r=daisuke
I found several problems:

Problem 1:

`getViewUpdate()` is allowed to be async and `UrlbarView` [awaits it](https://searchfox.org/mozilla-central/rev/a0ebb2a2c286c1d98d7ae93d043f65ed9970108b/browser/components/urlbar/UrlbarView.sys.mjs#2017) even though
the `Weather` implementation is not async. That means the summary text content
will be updated asyncly, so `browser_weather.js` needs to wait for it.

This is the cause of the recent frequent failures.

Problem 2:

This has to do with `add_tasks_with_rust()`. When it disables the Rust backend
and forces sync, the JS backend will sync `Weather` with remote settings. Since
keywords are present in remote settings at that point, `Weather` will then start
fetching. Each task that uses `add_tasks_with_rust()` needs to wait for this
fetch to finish. Otherwise `weather.suggestion` may be null. To fix this, I
added a way for tests to register a setup function that will run each time
`add_tasks_with_rust()` calls an original task.

This is the cause of infrequent failures that go back to at least when Rust was
enabled by default. I think this might be the cause of recent failures in
`test_weather.js` and `test_weather_keywords.js` too so I did the same thing
there.

Problem 3:

`browser_weather.js` sometimes times out in verify mode, so I requested a longer
timeout. It looks like the test finishes, it just takes a long time sometimes.

Problem 4:

`test_weather_keywords.js` sometimes times out in verify mode. This test takes
forever to run, especially now that it uses `add_tasks_with_rust()`. I added a
`skip-if` for verify mode. It's fine to skip verify mode for this test. Once we
remove the JS backend, we can probably remove the `skip-if`. If it still times
out, we could use `requesttimeoutfactor` or split it up.

Differential Revision: https://phabricator.services.mozilla.com/D204138
2024-03-12 03:34:18 +00:00
mcheang
e86c953b7b Bug 1870685 - Ensure mochi browser chrome tests pass with search-config-v2 enabled. r=Standard8
Depends on D202637

Differential Revision: https://phabricator.services.mozilla.com/D204133
2024-03-11 17:07:13 +00:00
Mark Banner
57d07fefcd Bug 1884623 - Fix documentation warning in browser/components/urlbar/docs/overview.rst.
Differential Revision: https://phabricator.services.mozilla.com/D204264
2024-03-11 16:26:43 +00:00
Mark Banner
afdbce2ec3 Bug 1884623 - Update more jsm references in production code and docs in browser/. r=mossop,extension-reviewers,omc-reviewers,migration-reviewers,robwu,mconley,aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D204182
2024-03-11 15:26:28 +00:00
Marco Bonardo
c81d07de87 Bug 1882815 - Enable cross-container Tab Search for Release. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D203731
2024-03-09 12:05:45 +00:00
Marco Bonardo
36ad633e1e Bug 1883845 - Switch to tab entries in Top Sites (zero prefix) don't support cross container search. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D203730
2024-03-09 12:05:44 +00:00
Dale Harvey
c4a54f94f9 Bug 1781972 - Defer loading QuickActions until they are first queries. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D203901
2024-03-09 10:38:13 +00:00
Anna Yeddi
d4a5e8966d Bug 1882430 - Ensure isUnlabeledUrlBarOption is checked before failing the label check in AccessibilityUtils. r=Jamie
Adding the check in one more place that is failing on Linux.

This should resolve the failing of `browser/components/urlbar/tests/browser/browser_acknowledgeFeedbackAndDismissal.js` test with a11y-checks jobs, thus removing the temporary `fail-if` notation from its test manifest.

Differential Revision: https://phabricator.services.mozilla.com/D202897
2024-03-08 11:25:14 +00:00
James Teh
0cab7c24b4 Bug 1267488: If no HTML input radio in a group is checked, only make the first radio in the group tabbable instead of all of them. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D202681
2024-03-08 07:03:28 +00:00
Drew Willcoxon
32ab59c29a Bug 1883482 - Transfer row labels to dismissal acknowledgment tips in the urlbar. r=dao,desktop-theme-reviewers
This makes sure the row label transfers to the dismissal acknowledgment tip, if
the dismissed row has a label.

With that fixed, there's one other cosmetic problem where the tip's top border
is right up against the row label. It doesn't look good. I added some additional
space between the label and border.

Differential Revision: https://phabricator.services.mozilla.com/D203559
2024-03-07 20:07:49 +00:00
Drew Willcoxon
3d5ff2451f Bug 1884014 - Make the Suggest Rust backend always ingest on startup. r=lina
This modifies the Rust backend so it always ingests whenever it's enabled,
including on every startup.

Ideally we would test a schema update, but since the current schema version is
hardcoded Rust, I don't think that's possible.

Differential Revision: https://phabricator.services.mozilla.com/D203855
2024-03-07 02:51:01 +00:00