Commit Graph

180 Commits

Author SHA1 Message Date
kernp25
cb1f1d5155 Bug 1939658 - Replace new URL usage with URL.parse/URL.canParse where possible. r=robwu,Standard8,Gijs,mtigley,pdahiya,settings-reviewers,credential-management-reviewers,devtools-reviewers,tabbrowser-reviewers,places-reviewers,omc-reviewers,migration-reviewers,firefox-desktop-core-reviewers ,home-newtab-reviewers,webcompat-reviewers,urlbar-reviewers,twisniewski,mossop,dao,nchevobbe,webdriver-reviewers,whimboo,issammani,mconley,nbarrett,beth
Differential Revision: https://phabricator.services.mozilla.com/D233071
2025-02-10 15:24:32 +00:00
Stephanie Cunnane
c9ddaf4b3d Bug 1932716 - Remove legacy urlbar.tips scalar and Glean urlbar.tips labeled counter. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D236590
2025-02-07 14:53:12 +00:00
Butkovits Atila
b061588f31 Backed out changeset 2c11770a86dc (bug 1939658) for causing failures at test_JsonSchemaValidator.js. CLOSED TREE 2025-02-04 13:07:29 +02:00
kernp25
cd2f76670a Bug 1939658 - Replace new URL usage with URL.parse/URL.canParse where possible. r=robwu,Standard8,Gijs,mtigley,pdahiya,settings-reviewers,credential-management-reviewers,devtools-reviewers,tabbrowser-reviewers,places-reviewers,omc-reviewers,migration-reviewers,firefox-desktop-core-reviewers ,home-newtab-reviewers,webcompat-reviewers,urlbar-reviewers,twisniewski,mossop,dao,nchevobbe,webdriver-reviewers,whimboo,issammani,mconley,nbarrett,beth
Differential Revision: https://phabricator.services.mozilla.com/D233071
2025-02-04 08:25:28 +00:00
Yazan Al Macki
0b1aec3a3d Bug 1943272 - Update support icon protocol list in UrlbarUtils to match places. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D235285
2025-01-28 14:25:51 +00:00
Alexandru Marc
9596ea4d17 Backed out changeset a2f2005b8637 (bug 1943272) for causing xpcshell failures @ test_autofill_originsAndQueries.js CLOSED TREE 2025-01-24 09:37:55 +02:00
Yazan Al Macki
80518491a8 Bug 1943272 - Update support icon protocol list in UrlbarUtils to match places. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D235285
2025-01-24 06:45:38 +00:00
Drew Willcoxon
2b358f9832 Bug 1941100 - Move quick-suggest ping submission from UrlbarProviderQuickSuggest to AdmWikipedia. r=daisuke
This makes a number of changes. The main point is to fix the bug, and I did some
refactoring to accomplish that. Summary of changes:

Move submission of the `quick-suggest` ping from `UrlbarProviderQuickSuggest` to
`AdmWikipedia`.

Add `SuggestProvider.onImpression()` and `onEngagement()`.
`UrlbarProviderQuickSuggest` forwards its own impression and engagement method
calls to the methods on the appropriate Suggest features. This is how
`AdmWikipedia` knows when to submit the ping.

Add a `details` param to `UrlbarProvider.onImpression()`, just like
`onEngagement()` already has. This is necessary because
`AdmWikipedia.onImpression()` needs to know whether the result was clicked since
that info is part of the impression ping.

Replace all `SuggestFeature.handleCommand()` implementations with
`onEngagement()`.

Remove `UrlbarProviderQuickSuggest.#dismissResult()`. The only suggestion types
that relied on it were AMP and Wikipedia. I replaced it with dismissal handling
in `AdmWikipedia.onEngagement()`.

Improve the related tests in a few ways: (1) Make the ping check more rigorous
(in `assertQuickSuggestPing()` in `head.js`), (2) simplify expected ping objects
(no more `type` and `payload` properties, just the properties that are expected
in the ping), (3) make `browser_telemetry_gleanEmptyStrings.js` more rigorous,
(4) factor out a helper function to trigger commands in xpcshell tests.

Differential Revision: https://phabricator.services.mozilla.com/D233980
2025-01-14 19:54:56 +00:00
Daisuke Akatsuka
4f1c38adde Bug 1928997: Update tabs icon in Unified Search popup r=desktop-theme-reviewers,daleharvey,dao
Differential Revision: https://phabricator.services.mozilla.com/D233804
2025-01-13 04:32:44 +00:00
Butkovits Atila
ac928d48bf Backed out changeset a17f61626cba (bug 1928997) for causing failures at browser_searchMode_localOneOffs_actionText.js. CLOSED TREE 2025-01-13 04:29:25 +02:00
Daisuke Akatsuka
7bef269fe5 Bug 1928997: Update tabs icon in Unified Search popup r=desktop-theme-reviewers,daleharvey,dao
Differential Revision: https://phabricator.services.mozilla.com/D233804
2025-01-13 00:31:52 +00:00
Drew Willcoxon
d798414004 Bug 1938517 - Implement new "simplest" weather suggestion UI. r=fluent-reviewers,desktop-theme-reviewers,urlbar-reviewers,emilio,bolsson,daisuke
This makes a number of changes to support a new UI treatment for weather
suggestions in addition to the two existing treatments. Unfortunately we need
all three to experiment with, but hopefully after experimentation is done we can
remove the two existing treatments.

This patch refers to the new treatment as the "simplest" UI. The Figma is at [1]
although it doesn't reflect some details Josh and I have discussed. One of the
existing treatments is already called "simple", and this patch changes its name
to "simpler". The patch refers to the other existing treatment as "full". These
names are only informal because the Nimbus variable and fallback pref are
integers.

Because the new UI treatment is so simple, we can pretty much use the standard
rich suggestion UI for it. The existing treatments are dynamic. I say "pretty
much" because I did need to add a capability to rich suggestions,
`result.richSuggestionIconVariation`, which lets results set an `icon-variation`
attribute on their rows. Weather suggestions use it to choose the appropriate
weather icon in the CSS.

I also modified l10n string caching in a few ways to address a couple of
problems:

* I like how dynamic results can cache their strings lazily by setting
  `cacheable` in their l10n objects. Standard results can only cache their
  strings by adding them to `UrlbarView.#cacheL10nStrings()`. That method is
  getting pretty big, and it also doesn't work well with strings that have
  arguments since it's called to pre-cache strings before they're used, when
  there are no arguments. So I extended `cacheable` support to all l10n objects,
  not only those from dynamic results.
* Josh's spec calls for the temperature in the suggestion title to be bolded.
  There's no good way to do that right now. We have highlights, but they aren't
  useable for l10n strings. The simplest thing -- and what I've done before in
  cases like this -- is to include `<strong>` tags in the l10n string itself.
  That works except for when we have a cache hit with the l10n cache. In that
  case, we set the `textContent`, which of course renders the tag literally. So
  I added a `parseMarkup` option to l10n objects that says the cached string
  should be set as `innerHTML` instead. Actually, for security I parse the
  string into a sanitized document fragment. We could just always do this and
  get rid of `parseMarkup`, but it seems wasteful since most l10n strings don't
  need it.
* While addressing the previous two points, it made sense to move
  `setElementL10n()` from the view to `L10nCache`. That way all these
  cache-related functions are together.

Finally, Josh noticed one of the dark-mode colors in the icon SVG didn't have
enough contrast with the standard dark-mode panel background, so I updated that
to a new color he chose (from `#80808F` to `#9393A8`).

[1] https://www.figma.com/design/Hdi0oHB7trRcncyVAKZypO/accuweather-explorations?node-id=3548-15992&t=f4YUShEe5RkP2KEg-1

Differential Revision: https://phabricator.services.mozilla.com/D232703
2024-12-27 18:11:23 +00:00
Dale Harvey
fd02dcf56d Bug 1930441 - Add telemetry type for search mode actions. r=daisuke,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D232880
2024-12-25 21:33:53 +00:00
mcheang
f8ea71ac19 Bug 1933003 - Add support to use restricted search keywords in both en-US and the localized language. r=mak,fluent-reviewers,settings-reviewers,urlbar-reviewers,mossop
This patch adds English restrict keyword strings to the enUS-searchFeature.ftl
file. The restrictKeywords providers return an array of keywords for their
l10nRestrictKeywords property. The first is the localized keyword, and the
second is the English keyword. If the user is in the English locale, the
providers return an array with one element: the English keyword.

Differential Revision: https://phabricator.services.mozilla.com/D230009
2024-12-24 22:40:09 +00:00
Nika Layzell
3e32140186 Bug 1935714 - Part 3: Avoid using nsISupportsCString to initialize nsStringInputStream instances, r=xpcom-reviewers,necko-reviewers,extension-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,firefox-ai-ml-reviewers,mccr8,jteow,mcheang,ochameau,robwu,tarek
The method is equivalent to the `setByteStringData` method on `nsIStringInputStream`, which has been used to replace the `.data` setter in these places. There may still be callers of the `.data` getter/setter, however they aren't easy to find.

Differential Revision: https://phabricator.services.mozilla.com/D232257
2024-12-18 21:10:32 +00:00
Norisz Fay
86e902d55a Backed out changeset 2f7058ea3047 (bug 1935714) for causing mochitest failures on test_progress_events_for_gzip_data.html 2024-12-17 22:29:32 +02:00
Nika Layzell
bb544297d5 Bug 1935714 - Part 3: Avoid using nsISupportsCString to initialize nsStringInputStream instances, r=xpcom-reviewers,necko-reviewers,extension-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,firefox-ai-ml-reviewers,mccr8,jteow,mcheang,ochameau,robwu,tarek
The method is equivalent to the `setByteStringData` method on `nsIStringInputStream`, which has been used to replace the `.data` setter in these places. There may still be callers of the `.data` getter/setter, however they aren't easy to find.

Differential Revision: https://phabricator.services.mozilla.com/D232257
2024-12-17 17:00:15 +00:00
Drew Willcoxon
85301b6753 Bug 1932502 - Remove the Suggest JS backend: Part 3: Remove the "remote-settings" and "rs_" source. r=daisuke
This is part 3 of 4. It removes the `"remote-settings"` source used internally
and its `rs_` counterpart in telemetry result types.

Depends on D231466

Differential Revision: https://phabricator.services.mozilla.com/D231467
2024-12-11 20:50:46 +00:00
Florian Quèze
4f822b5992 Bug 1927093 - Migrate scalars to use Glean APIs for urlbar.picked.*, r=chutten,urlbar-reviewers,Standard8.
Differential Revision: https://phabricator.services.mozilla.com/D226511
2024-11-05 13:22:57 +00:00
Drew Willcoxon
cbbe362eed Bug 1925734 - Remove UrlbarProviderWeather, the weatherKeywords Nimbus variable, and JS-backend support for weather suggestions. r=daisuke
Depends on D225051

Differential Revision: https://phabricator.services.mozilla.com/D226214
2024-10-22 01:59:13 +00:00
Dale Harvey
37dbf730f3 Bug 1922570 - Show global actions on seperate row from heuristic. r=daisuke,desktop-theme-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D225051
2024-10-21 19:36:57 +00:00
Moritz Beier
1bcaefc14e Bug 1389229 - Deduplicate urlbar history results that only differ by their URL fragment. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D222672
2024-10-11 07:18:04 +00:00
mcheang
ce3fcffe0e Bug 1921549 - List the keywords in the results panel when a user types @. r=mak,fluent-reviewers,urlbar-reviewers
This patch adds the keywords to the result title for TokenAliasEngine and
RestrictKeyword results. The TokenAliasEngine results may have more than one
keyword if the user has set a custom keyword for that engine. This can help
remind the user what keywords are available as they are typing or if they
have forgotten a keyword, they can type `@` to quickly see the list of keywords
to search with.

The result title looks like this:

For Engines:
 @[keywords] - Search with [Engine]
For Restrict Keywords:
@[keyword] - Search [Restrict]

Differential Revision: https://phabricator.services.mozilla.com/D224017
2024-10-02 18:42:29 +00:00
Daisuke Akatsuka
db8cb594cd Bug 1919857: Include unified search button telemetry r=urlbar-reviewers,daleharvey,adw
Differential Revision: https://phabricator.services.mozilla.com/D223283
2024-10-01 05:02:23 +00:00
Stanca Serban
166b2ca10e Backed out changeset b21e5102719d (bug 1919857) for causing mochitests failures in browser_UrlbarInput_searchTerms_searchModeSwitcher.js. 2024-10-01 01:32:44 +03:00
Daisuke Akatsuka
ffc01cfe63 Bug 1919857: Include unified search button telemetry r=urlbar-reviewers,daleharvey,adw
Differential Revision: https://phabricator.services.mozilla.com/D223283
2024-09-30 21:02:37 +00:00
mcheang
38e8fa20a9 Bug 1917992 - Add scalar telemetry for picked restrict keyword result and glean telemetry for abandonment and engagement. r=mak,urlbar-reviewers
This patch adds telemetry for when the user sees or interacts with restrict keyword results.
Following is an overview of the interactions that will trigger the telemetry to be recorded:

When the user types `@` and selects one of the restrict results, the scalar telemetry will be recorded:

  - `urlbar.picked.restrict_keyword_tabs`
  - `urlbar.picked.restrict_keyword_bookmarks`
  - `urlbar.picked.restrict_keyword_history`
  - `urlbar.picked.restrict_keyword_actions`

For example, we can select the tabs result in multiple ways for the telemetry to be recorded:
  - type`@` and click on tabs result
  - type`@` and arrow down to tabs result and press enter
  - type partial keyword `@t` and press enter to autofill
  - type partial keyword `@t` and press tab and then enter


When the user types `@` and **does not** select one of the restrict results, the glean abandonment will be recorded:
```
    groups:
      "general,general,general,general,general,general,restrict_keyword,restrict_keyword,restrict_keyword,restrict_keyword",
    results:
      "search_engine,search_engine,search_engine,search_engine,search_engine,search_engine,restrict_keyword_bookmarks,restrict_keyword_tabs,restrict_keyword_history,restrict_keyword_actions",
```

When the user types `@` and **does** select one of the restrict results, the glean engagement will be recorded:
```
    groups:
      "general,general,general,general,general,general,restrict_keyword,restrict_keyword,restrict_keyword,restrict_keyword",
    results:
       "search_engine,search_engine,search_engine,search_engine,search_engine,search_engine,restrict_keyword_bookmarks,restrict_keyword_tabs,restrict_keyword_history,restrict_keyword_actions",
    selected_result: `restrict_keyword_${category}`,
```

For the `selected_result` in engagement telemetry, the `category` variable will be `tabs, bookmarks, history, or actions`.

Differential Revision: https://phabricator.services.mozilla.com/D222355
2024-09-23 18:21:41 +00:00
Daisuke Akatsuka
51c5b9ed62 Bug 1913204: Apply container color border to secondary action button for tab switch r=desktop-theme-reviewers,urlbar-reviewers,daleharvey,dao
Differential Revision: https://phabricator.services.mozilla.com/D221114
2024-09-09 11:53:09 +00:00
Drew Willcoxon
26cdd4f115 Bug 1914542 - Replace UrlbarResult.exposureResultType and exposureResultHidden with a single simple value. r=mak
This replaces `UrlbarResult.exposureResultType` and `exposureResultHidden` with
a single simple value called `exposureTelemetry`. Please see the bug for the
rationale.

Other changes:

* For convenience, make `UrlbarPrefs.get("exposureResults")` return a `Set` so
  consumers don't have to parse the string value.
* Simplify handling of result properties in `check_results()` (xpcshell tests)
* Add more tasks/checks to test_exposure.js

Depends on D219939

Differential Revision: https://phabricator.services.mozilla.com/D219942
2024-08-27 20:12:55 +00:00
Dale Harvey
9addf821be Bug 1907147 - Restore Actions search mode. r=desktop-theme-reviewers,urlbar-reviewers,fluent-reviewers,daisuke,dao,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D216518
2024-08-22 16:18:57 +00:00
mcheang
f9e8516afa Bug 1912045 - Autofill for intuitive search keywords. r=daleharvey,urlbar-reviewers,mak
**Description**
- Add autofill functionality to UrlbarProvider Restrict Keywords.

**Acceptance Criteria**
- There are 3 restrict keywords `@history`, `@bookmarks`, and `@tabs`
- When the user types @ followed by the beginning of the search keyword: `@h`, `@hi`, `@his`, `@hist` etc. the user should be able to autofill the rest of the search by pressing tab
- The autofill should highlight the typed letters from the user, and show the entire keyword following what the user typed. For example:
- If the user typed `@hist` , autofill should highlight what the user typed and show the rest of the keyword `@history`:

**Example steps to test `@history` :**
- set `browser.urlbar.searchRestrictKeywords.featureGate` to true
- type out the full keyword and space `@history` , address bar should show results panel with history results
- type `@h` and press right arrow, shows results panel with history results
- type `@h` and press enter, shows results panel with history results
- type `@h` and press tab, does not show panel but selects the history restrict result. When the user starts typing, it will search their history and show results panel with history results

Differential Revision: https://phabricator.services.mozilla.com/D218742
2024-08-18 17:51:37 +00:00
Karandeep
d1dbab6e8d Bug 1912040 - Remove all instances of onLegacyEngagement(). r=adw,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D219068
2024-08-14 12:38:26 +00:00
Drew Willcoxon
067c9bc5b1 Bug 1911683 - Remove shouldNavigate for dynamic result types and make UrlbarUtils.getUrlFromResult() fall back to payload.url for all results. r=daisuke
Please see the bug for info.

Differential Revision: https://phabricator.services.mozilla.com/D218607
2024-08-06 01:41:04 +00:00
mcheang
934e5f7581 Bug 1902537 - Create UrlbarProviderRestrictKeywords to show localized bookmarks, history, and tabs restrict keywords results. r=mak,settings-reviewers,urlbar-reviewers
This patch includes:
- A new UrlbarProviderRestrictKeywords class
- Showing localized Search with Bookmarks, Search with History, Search with Tabs results after the user types @
- Add search restrict keywords to preferences UI Search Shortcuts table
- Hiding search restrict keyword behind browser.urlbar.searchRestrictKeywords.featureGate pref

Differential Revision: https://phabricator.services.mozilla.com/D213697
2024-07-19 23:45:58 +00:00
Drew Willcoxon
5b6f606320 Bug 1907696 - Change the Suggest ingest strategy so only enabled suggestion types are ingested. r=daisuke
Please see the bug for context. This changes how ingest works. Right now we
ingest all "default" suggestion types at once. This patch causes a suggestion
type to be ingested only when it's enabled.

Before this patch, there are two times ingest happens, on startup and when the
ingest timer fires.

With this patch, there are now a few times ingest happens:

* On startup (as before). `SuggestBackendRust` will ingest all registered and
  enabled suggestion types.
* When the ingest timer fires (as before). Similar to startup, all registered
  and enabled types will be ingested.
* When a suggestion type becomes enabled. I added this functionality to
  `BaseFeature.update()` so that each feature gets this behavior automatically.

It's worth saying more about the startup case. On startup, all `BaseFeature`s'
initializations race each other. `SuggestBackendRust` is itself a `BaseFeature`,
so there's no guarantee it will be initialized before other `BaseFeature`s that
implement Rust suggestions. If any `BaseFeature`s are initialized before
`SuggestBackendRust`, they'll try to ingest but nothing will happen because
`SuggestBackendRust` won't be initialized yet. Once `SuggestBackendRust` is
initialized, it will ingest suggestions for all registered `BaseFeature`s that
already tried and failed to ingest. And after `SuggestBackendRust` initializes,
any `BaseFeature`s that are initialized later will be able to successfully
ingest.

Differential Revision: https://phabricator.services.mozilla.com/D216488
2024-07-17 01:25:44 +00:00
James Teow
fa3b3d1fea Bug 1905100 - Remove Persisted Search Tip - r=adw,urlbar-reviewers
The onboarding will be handled by OMC who will help with the
messaging for all the scotch bonnet features.

Differential Revision: https://phabricator.services.mozilla.com/D215234
2024-07-01 23:45:47 +00:00
Dale Harvey
35e363801a Bug 1893067 - Add actions key to glean urlbar metrics. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D214763
2024-06-29 21:50:46 +00:00
Marco Bonardo
44b8489d02 Bug 1876513 - Address bar should not prefix URIs that will be handled by schemeless HTTPS-First. r=daleharvey
When the address bar adds a non typed protocol, don't show the urifixup added
protocol to the user, as https-first may upgrade it, and the whole experience
could be confusing for the user.

Differential Revision: https://phabricator.services.mozilla.com/D213443
2024-06-20 09:02:15 +00:00
Dale Harvey
db1cca7c8d Bug 1871054 - Dont show suggestions for single character query. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D213774
2024-06-17 13:18:59 +00:00
Dale Harvey
3a3707ff44 Bug 1891863 - Implement initial prototype of dedicated search button. r=dao,fluent-reviewers,desktop-theme-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D209469
2024-06-12 13:14:14 +00:00
Karandeep
bd970b997d Bug 1857236 - invoking onEngagement on every provider is error prone. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D202482
2024-05-15 13:13:02 +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
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
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
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
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
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