Commit Graph

241 Commits

Author SHA1 Message Date
James Teow
2423c61e3e Bug 1920493 - Clear search mode in Persisted Search when loading a default SERP - r=adw,urlbar-reviewers
In the patch where I ensure the correct `searchMode` is added, I didn't consider the possibility a user could return to a default SERP. Thus, if there was a search mode chiclet, it should be cleared.

Differential Revision: https://phabricator.services.mozilla.com/D223141
2024-09-24 03:32:02 +00:00
abhishekmadan30
9605ca52bd Bug 1895334 - Grey out Copy without Site Tracking option when nothing can be stripped. r=pbz,urlbar-reviewers,anti-tracking-reviewers,dao
Co-authored-by: Manuel Bucher <manuel@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D215815
2024-09-23 22:11:50 +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
James Teow
9f2653fd25 Bug 1913312 - Enable Persisted Search for non-default app provided search engines - r=adw,urlbar-reviewers
There's two main changes:

- Change `getSearchTermIfDefaultSerpUri` to enable it work for any app-provided engine.
- Show the correct Search Chicklet / Unified Search Mode Chicklet when the user loads a non-default SERP. Recall that Persisted Search is enabled in Nightly independent of Scotch Bonnet.

**Issue 1:**

 `this.searchMode` is not always known or consistent with the non-default search page when `setURI` is called.

Some scenarios:

- Clear search mode, switch tab, return to the original. The absence of search mode seems acceptable because the user was potentially in the middle of modifying their search or navigating to a URL.
- Clear search mode and reload a non-default SERP.
- Switch search mode, but reload non-default SERP.
- Go back/forward in tabhistory to return to a non-default SERP.

In the latter three cases, if the search terms were to persist again, I'd expect the most accurate search mode to be present.

**Issue 2:**

`userTypedValue` has been used as an indicator for whether or not search terms should persist. However, entering search mode causes userTypedValue to have a value, so that it can be restored when switching back to the current tab and across sessions. Thus, on blur, I have a slightly more complicated check to ensure the revert button is consistent regardless of whether the engine is default or non-default.

**Issue 3:**

Lastly, it's possible for the revert button to show up when switching from tab to tab while the address bar is focused. I added an additional check in this patch since it's a small addition, but I can move it out if it overcomplicates things.

I'm not 100% confident my solution is ideal since I ended up having to add hacky awaits in `browser_UrlbarInput_searchTerms_searchMode.js` for the search mode to appear...

Differential Revision: https://phabricator.services.mozilla.com/D222846
2024-09-20 19:59:45 +00:00
Marco Bonardo
4af32e7c32 Bug 1898155 - Untrim URL in the address bar immediately when focused by keyboard. r=jteow,urlbar-reviewers
When focusing the urlbar with the mouse we must avoid modifying or
shifting the URL to support operations like double-click or drag to select.
When focusing with the keyboard though we don't have such restrictions
and we can make editing and selection more visually coherent.
This patch is not intercepting commands on mainKeyset, because F6 and
TAB bypass all of that. We instead detect focus following a keydown,
though we must avoid untrimming on TabSelect shortcuts.
Note direct calls to .focus() without a peripheral follow the mouse
behavior, because code (external callers) and tests rely on that.

Differential Revision: https://phabricator.services.mozilla.com/D222138
2024-09-18 14:12:05 +00:00
James Teow
d5710cd89a Bug 1919193 - Simplify Persisted Search UI - r=adw,desktop-theme-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D222489
2024-09-18 04:44:31 +00:00
Marco Bonardo
c9cadb9fef Bug 1909189 - Don't shift URL in the Address Bar on mouse focus, delay DOM changes to the first input event. r=jteow,daleharvey,desktop-theme-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D221031
2024-09-16 08:30:48 +00:00
Daisuke Akatsuka
b4f5e812ce Bug 1915250: Open search engine page directly if click/enter with shiftKey r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D221003
2024-09-13 22:08:26 +00:00
Dale Harvey
e230b4cd2c Bug 1917186 - Escape searchMode when uses presses Esc. r=daisuke,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221800
2024-09-13 20:27:31 +00:00
Dale Harvey
b0ce3c14e9 Bug 1893071 - Enter searchMode when using contextual search. r=Standard8,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D220071
2024-09-03 15:11:11 +00:00
Jason Prickett
6d13ee8ae8 Bug 1912351 - Create onSearch trigger and targeting r=mviar,omc-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D219519
2024-08-27 16:46:02 +00:00
Mark Banner
28e4ba7093 Bug 1870226 - Upgrade eslint-plugin-jsdoc to version 43.2.0. r=frontend-codestyle-reviewers,credential-management-reviewers,issammani
This switches from the deprecated/removed jsdoc/newline-after-description rule to using the replacement jsdoc/tag-lines rule.

Differential Revision: https://phabricator.services.mozilla.com/D219512
2024-08-23 16:43:57 +00:00
Butkovits Atila
11a5a23896 Backed out 7 changesets (bug 1870226) for causing build bustages. CLOSED TREE
Backed out changeset 619244623dba (bug 1870226)
Backed out changeset e85a5647cae4 (bug 1870226)
Backed out changeset 21ea9baf83ea (bug 1870226)
Backed out changeset a506c0f0ce28 (bug 1870226)
Backed out changeset 77c78201a206 (bug 1870226)
Backed out changeset 7a98dfef087f (bug 1870226)
Backed out changeset f64ad89c2406 (bug 1870226)
2024-08-23 12:22:02 +03:00
Mark Banner
1ee70a0f13 Bug 1870226 - Upgrade eslint-plugin-jsdoc to version 43.2.0. r=frontend-codestyle-reviewers,credential-management-reviewers,issammani
This switches from the deprecated/removed jsdoc/newline-after-description rule to using the replacement jsdoc/tag-lines rule.

Differential Revision: https://phabricator.services.mozilla.com/D219512
2024-08-23 08:55:49 +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
James Teow
e18a9d45a5 Bug 1909301 - Retain dedicated search mode when search terms don't change - r=adw,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218739
2024-08-15 11:12:11 +00:00
James Teow
f903e4c61a Bug 1901871 - Part 1: Integrate Persisted Search Terms with the Unified Search Button - r=daleharvey,adw,fluent-reviewers,desktop-theme-reviewers,urlbar-reviewers,dao
The design: https://www.figma.com/design/4co0kOw3eJMQK3HRpTuD1b/Unified-search-button?node-id=54-39399&t=mkuI12rU1RQ3Cdke-0

Differential Revision: https://phabricator.services.mozilla.com/D215993
2024-08-15 11:12:10 +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
Dale Harvey
4f2b312c87 Bug 1907146 - Ensure SearchModeSwitcher detects searchmode changes. r=urlbar-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D216232
2024-07-25 19:26:53 +00:00
Marco Bonardo
afba2eac66 Bug 1909676 - Switching to a tab whose urlbar was cleared restores the URL but doesn't select it. r=jteow,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D217595
2024-07-25 08:28:27 +00:00
Karandeep
b207f35b42 Bug 1903633 - Integrate the UrlbarSearchTermsPersistence component with remote setting. r=jteow,firefox-desktop-core-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D215777
2024-07-23 12:14:44 +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
Dale Harvey
0c3d03e94d Bug 1905510 - Ensure SearchModeSwitcher popup opens in correct window. r=urlbar-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D215311
2024-07-19 21:43:39 +00:00
Marco Bonardo
164db06ff2 Bug 1903266 - Copied URL from loading new tab does not include scheme. r=jteow,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D216917
2024-07-19 12:29:09 +00:00
DJ
519ee01824 Bug 1876558 - deactivate tab preview when urlbar receives input. r=tabbrowser-reviewers,dao,urlbar-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D214870
2024-07-17 20:37:36 +00:00
Marco Bonardo
c5372e4d26 Bug 1902237 - Enable untrimOnUserInteraction and trimHttps with ScotchBonnet. r=daleharvey
This leaves out `security.insecure_connection_text.enabled` and
`security.insecure_connection_text.pbmode.enabled`, that should also be part of
ScotchBonnet, but are managed by a different component.

Differential Revision: https://phabricator.services.mozilla.com/D216181
2024-07-17 09:34:48 +00:00
Marco Bonardo
c4bdac3b58 Bug 1906110 - Address bar content shifts when focusing on mousedown. r=jteow,desktop-theme-reviewers,urlbar-reviewers,dao
Shifting the input field position on mousedown can easily cause unwanted text
selection. We can avoid that by delaying pageproxystate change to mouseup, and
using an attribute to postpone other display changes.

Differential Revision: https://phabricator.services.mozilla.com/D215930
2024-07-17 09:31:36 +00:00
Stanca Serban
832439e884 Backed out changeset eec38ebb419b (bug 1876558) for causing mochitests failures in browser_tab_preview.js. CLOSED TREE 2024-07-12 21:57:33 +03:00
DJ
8325a8a7aa Bug 1876558 - deactivate tab preview when urlbar receives input. r=tabbrowser-reviewers,dao,urlbar-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D214870
2024-07-12 17:01:23 +00:00
Marco Bonardo
6ee1266afe Bug 1904829 - Don't handle repeated keydown in urlbar handler. r=urlbar-reviewers,dao
Avoid handling repeated keydown events in the urlbar handler as they are not
necessary and confuse our bookkeeping.

Differential Revision: https://phabricator.services.mozilla.com/D215918
2024-07-09 09:32:49 +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
Dale Harvey
8f27c5fa6e Bug 1903146 - Remove experiment.searchButton pref. r=urlbar-reviewers,dao,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D214671
2024-06-27 10:26:09 +00:00
Marco Bonardo
c33e249b2b Bug 1892934 - Domain highlighting doesn't work when detaching tabs. r=jteow
There's a timing issue where sometimes formatting happens too early on new
windows opening, so we await for the next RAF to happen.
Note there's already a test in browser_UrlbarInput_formatValue_detachedTab.js
covering this, and it's indeed failing intermittently, this may fix it.

The patch also avoids trimming when active mixed content may show a strikeout
https protocol. This is an uncommon state anyway because we block active mixed
content, and in the future we'll rely on the insecure label.

Differential Revision: https://phabricator.services.mozilla.com/D212906
2024-06-19 11:17:27 +00:00
Marco Bonardo
317e2fd13f Bug 1896128 - Pressing Home on trimmed urlbar value should put cursor at 0. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D212790
2024-06-13 14:55:52 +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
Marco Bonardo
88146e4c15 Bug 1897109 - Urlbar tests should run also with trimHttps enabled. r=jteow
Note this patch changes the urlbar behavior regarding the value put into the
input when a result is selected with the keyboard. We won't trim the value
anymore in most cases.
Trimming makes too easy for the user to transform https into http, and
in general it makes harder to predict the result after editing or copying from
the urlbar after selecting a result.
This resembles the behavior of other mainstream browsers.
The only special case where we still trim the value, is when we add http to a
schemeless user typed value, as we may be using https first, then showing
http would be confusing. Though if trimming the url may transform it into a
search, we still don't trim and accept showing a potentially confusing protocol.

Differential Revision: https://phabricator.services.mozilla.com/D212465
2024-06-11 08:06:43 +00:00
Karandeep
b706203c2c Bug 1898437 - Fix TypeError on re-submitting a search link by ensuring details.result is defined. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D212111
2024-06-07 12:04:02 +00:00
Dão Gottwald
86f5d1f8d0 Bug 1900575 - Make focused a proper boolean attribute. r=desktop-theme-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D212544
2024-06-04 17:34:07 +00:00
Moritz Beier
0dcee9a58f Bug 1610530 - Use classes instead of ids to access urlbar elements from UrlbarInput. r=dao,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D212095
2024-06-04 12:58:52 +00:00
Moritz Beier
9c75a90b88 Bug 1893228 - Move address bar expandos set on browsers to the #browserStates WeakMap. r=dao,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D211574
2024-05-31 16:04:16 +00:00
Dale Harvey
7cf2ed740f Bug 1893069 - Add 'browser.urlbar.scotchBonnet.enableOverride' pref. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D210374
2024-05-27 21:56:56 +00:00
Marco Bonardo
0c2c9b1bab Bug 1893871 - When untrimming the URL adjust partial selection depending on whether the selected text is a valid URL. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D210027
2024-05-14 11:33:57 +00:00
Leeya
281cc0f354 Bug 1742889 - Rewrite consumers of whereToOpenLink to use BrowserUtils.whereToOpenLink. r=Gijs,search-reviewers,places-reviewers,firefox-desktop-core-reviewers ,home-newtab-reviewers,reusable-components-reviewers,hjones,nbarrett
Differential Revision: https://phabricator.services.mozilla.com/D208680
2024-05-08 14:33:17 +00:00
Abhishek Madan
310bd3f288 Bug 1884535 - Added error catching for Strip on Share.r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D209292
2024-05-06 19:11:26 +00:00
Stanca Serban
abbf8b4412 Backed out changeset ede7a0b15af0 (bug 1742889) for causing node tests failures. CLOSED TREE 2024-05-03 23:12:24 +03:00
Leeya
23b26e9421 Bug 1742889 - Rewrite consumers of whereToOpenLink to use BrowserUtils.whereToOpenLink. r=Gijs,search-reviewers,places-reviewers,firefox-desktop-core-reviewers ,home-newtab-reviewers,reusable-components-reviewers,hjones,nbarrett
Differential Revision: https://phabricator.services.mozilla.com/D208680
2024-05-03 19:05:59 +00:00
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