Commit Graph

65 Commits

Author SHA1 Message Date
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
631061e66c Bug 1897244 - Convert the QuickSuggest provider onLegacyEngagement to use the new notifications. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D218439
2024-08-05 17:08:40 +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
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
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
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
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
Karandeep
c394e93376 Bug 1855958 - Remove the experimental urlbar API (first patch). r=mak,extension-reviewers,desktop-theme-reviewers,robwu
ext-urlbar.js is unused but will be removed in a separate
patch to avoid test failures in condprof tests. Condprof tests may use
an outdated profile directory that still references ext-urlbar.js in
startupcache files, which triggers a test-only test failure in
mozilla::net::CheckForBrokenChromeURL.

Differential Revision: https://phabricator.services.mozilla.com/D199769
2024-02-05 17:04:37 +00:00
mcheang
4ffcfc6cbc Bug 1667639 - Make keyword at the start of the string take precedence over restrict symbols at the end of the string. r=mak
This patch modifies PlacesUtils to cache the keywords and adds functionality to
find a keyword. The Tokenizer calls PlacesUtils to know if the first word
is a keyword and if the first word is a keyword, then the rest of the search
string will be treated as text and Tokenizer won't filter any other restrict
symbols.

Differential Revision: https://phabricator.services.mozilla.com/D198208
2024-01-19 01:13:39 +00:00
Dale Harvey
9eadf1b3d7 Bug 1852442 - Remove delay for heuristic result. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D192462
2023-11-14 20:42:35 +00:00
Dão Gottwald
d8353059ce Bug 1852055 - [Firefox Suggest Opt-in Experiment] Implement opt-in UI at the top of the results list. r=daleharvey,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D193198
2023-11-10 11:28:14 +00:00
Dale Harvey
9aed4a17ff Bug 1852848 - Implement recent searches provider. r=mak,fluent-reviewers,flod,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189104
2023-10-11 00:06:32 +00:00
Karandeep
b0382c3163 Bug 1842230 - URL bar suggested action for paste when clipboard contains valid URL. r=mak,flod
Differential Revision: https://phabricator.services.mozilla.com/D183747
2023-08-01 11:51:59 +00:00
Gregory Pappas
e9950eccfd Bug 1845311 - Use ChromeUtils.defineLazyGetter in more places r=arai,webdriver-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,anti-tracking-reviewers,sessionstore-reviewers,pbz,joschmidt,robwu,issammani,bytesized,owlish,dao
Differential Revision: https://phabricator.services.mozilla.com/D184481
2023-07-26 16:28:11 +00:00
Mark Banner
88e658c23d Bug 1792824 - Convert ObjectUtils.jsm to an ES module. r=barret,necko-reviewers,devtools-reviewers,kershaw
Depends on D183308

Differential Revision: https://phabricator.services.mozilla.com/D183309
2023-07-12 08:07:23 +00:00
Marco Bonardo
b98a9b276e Bug 1842381 - The address bar chunk timer is not firing early when all heuristic providers are done. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D183164
2023-07-11 08:27:37 +00:00
Marco Bonardo
0a487b36b8 Bug 1816572 - Allow more time for Address Bar heuristic results to be returned. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D181128
2023-07-07 15:48:34 +00:00
Marco Bonardo
b99e0f7f7e Bug 1827770 - Remove isPrivate argument from onEngagement() since it can be inferred. r=daleharvey
We can't use context.isPrivate because sometimes context is undefined.
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1841762 about that.

Differential Revision: https://phabricator.services.mozilla.com/D182772
2023-07-07 10:01:50 +00:00
Marco Bonardo
ff3c4323fc Bug 1827770 - Remove QueryContext.view and pass the controller to onEngagement() instead. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D182771
2023-07-07 10:01:50 +00:00
Butkovits Atila
ceeb51063d Backed out changeset 986f4f6398a4 (bug 1816572) for causing failures at browser_search_bookmarks.js. CLOSED TREE 2023-07-04 16:29:04 +03:00
Marco Bonardo
dc48e94cda Bug 1816572 - Allow more time for Address Bar heuristic results to be returned. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D181128
2023-07-04 09:28:46 +00:00
James Teow
5eccd3fe6f Bug 1837239 - Remove the Preloaded Top URLs feature - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D180246
2023-06-13 18:27:12 +00:00
mcheang
9864559021 Bug 1648188 - Fix SearchService init failures so that the address bar can be used to search history and bookmarks. r=Standard8,mak
This patch refactors the SearchService private initialized variables and how
the SearchService stores its initialization status. These changes capture whether
the SearchService has succeeded, failed or hasn't finished initialization yet.

There are also changes made to UrlbarSearchUtils on handling when SearchService
has failed to initialize or when it hasn't finished initializing yet and we wait.
In the case where the SearchService has failed on initialization, We allow
the code to continue so that it can reach UrlbarProviderPlaces. Once we
are able to reach UrlbarProviderPlaces, we can make database calls for the user's
history and bookmarks. This allows the user to interact with the addressbar and
search their history and bookmarks even if SearchService has failed to initialize.

Differential Revision: https://phabricator.services.mozilla.com/D176936
2023-05-30 18:34:51 +00:00
Karandeep
bab497399a Bug 1806120 - Pass down window handle to provider. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D178436
2023-05-24 14:19:01 +00:00
Drew Willcoxon
c26ec9b3d6 Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak
This removes `UrlbarProvider.pickResult()` and `blockResult()` in favor of
handling picks and dismissals through `onEngagement()`. A number of providers
use those two methods, so this revision touches a lot of files.

Handling dismissals through `onEngagement()` means `UrlbarInput.pickResult()`
can no longer tell whether a result is successfully dismissed, so it can't
remove the result anymore. (Maybe `onEngagement()` could return some value
indicating it dismissed the result, but I don't want to go down that road.)
Instead, I split `UrlbarController.handleDeleteEntry()` into two methods: a
public one that removes the result and notifies listeners, and a private one
that handles dismissing the selected result internally in
UrlbarController. Providers that have dismissable results should now implement
`onEngagement()` and call `controller.removeResult()`.

I made some other improvements to engagement handling. There's still room for
more but this patch is big enough already.

Other notable changes:

Include the engaged result in engagement notifications so providers have easy
access to it and can respond to clicks and dismissals more easily. That also
lets us stop passing `selIndex` and `provider` to `engagementEvent.record()`
since now it can compute those from the passed-in result.

Add the concept of `isSessionOngoing` to engagement notifications so providers
can tell whether an engagement ended the search session. Right now, providers
like quick suggest that record a bunch of provider-specific legacy telemetry
assume that `onEngagement()` ends the session, but that's no longer true.

Unify result buttons and result menu commands by setting
`element.dataset.command` on buttons (hopefully we can remove buttons soon, at
least the ones that aren't tip buttons)

Make sure we always notify providers on engagement even on dismissals or
when skipping legacy telemetry

Move dismissal of restyled search suggestions and history results from
`UrlbarController.handleDeleteEntry()` to the Places provider

Move dismissal of form history results from
`UrlbarController.handleDeleteEntry()` to the search suggestions provider

In the Places provider, remove the unused `_addSearchEngineMatch()` method. Also
remove the code in the "searchengine" case that creates a non-search-history
result. This code is unreached because the only time the provider creates a
"searchengine" match it also sets `isSearchHistory` to true.

In `UrlbarTestUtils.promiseAutocompleteResultPopup()`, change the default value
of the `fireInputEvent` param from false to true. This is necessary because
without a starting input event, the start event info in `engagementEvent` will
be null, so when `engagementEvent.record()` is called at the end of the
engagement, it will bail, and providers will not be notified of the engagement.
IMO true is a better default value anyway because input events will typically be
fired when the user performs a search.

Differential Revision: https://phabricator.services.mozilla.com/D174941
2023-04-13 06:03:33 +00:00
Daisuke Akatsuka
b30c8f79a4 Bug 1820453: Introduce unsortedResults to the query r=adw
Differential Revision: https://phabricator.services.mozilla.com/D171673
2023-03-08 02:30:33 +00:00
Drew Willcoxon
9f4378e671 Bug 1814732 - Move weather suggestions to their own provider. r=daisuke
This moves weather suggestions from the quick suggest provider to their own
provider. This will make it easier to implement weather suggestions that are
triggered by keyword instead of being shown on zero-prefix.

It does the following:

* Copies UrlbarProviderQuickSuggest.sys.mjs to UrlbarProviderWeather.sys.mjs
* Removes everything weather-related from UrlbarProviderQuickSuggest.sys.mjs
* Removes everything not weather-related from UrlbarProviderWeather.sys.mjs
* Makes some simplifications to the new provider since it doesn't need to
  support quick suggest suggestions
* Removes `result.payload.isWeather` since now we can use `result.providerName`
* This does *not* change any telemetry

Differential Revision: https://phabricator.services.mozilla.com/D168738
2023-02-07 02:26:54 +00:00
Daisuke Akatsuka
5e04583fb5 Bug 1791657: Show page title if it is in places. r=adw,mak
Depends on D159243

Differential Revision: https://phabricator.services.mozilla.com/D157891
2023-01-24 22:35:15 +00:00
Gregory Pappas
61f7f15f7d Bug 1779400 - Let omnibox API work in private windows r=mak
Differential Revision: https://phabricator.services.mozilla.com/D166681
2023-01-13 10:55:59 +00:00
Marco Bonardo
e14c64ef54 Bug 1805702 - Log engagement event regardless of recording being enabled. r=daisuke
Logs engagement telemetry for debug purposes, regardless of it being reported
upstream.
Also changes a couple other logs to make browser.urlbar.logLevel = "Info"
more readable and usable.

Differential Revision: https://phabricator.services.mozilla.com/D164701
2022-12-15 08:59:22 +00:00
Hanna Jones
f147294407 Bug 1794823 - port site specific search from pine to central r=daleharvey
Some random thoughts:
* This is a minimal implementation - there were plans to expand this with autocomplete support that we never got around to
* I built this just from reading docs + poking around in the urlbar code, so there might be a more desireable way to do all of this
* We've gone back and forth between calling this "contextual search" and "site specific search," we should probably pick a name and stick to it
* There were never any design specs for this so the UI/UX was based off of existing urlbar results as they appeared in Flowstate
* There were some open questions around how we treat installing opensearch engines, since how they are handled here seems to differ from how we use them elsewhere
* I don't remember the reasoning for showing this result last in the urlbar, we may want to move it elsewhere

Differential Revision: https://phabricator.services.mozilla.com/D159052
2022-11-25 15:17:08 +00:00
Drew Willcoxon
05db5ab826 Bug 1800810 - Always record visible quick suggest results in engagement telemetry. r=dao
This is a follow up to D161866 and effectively reverts and replaces it with a
different approach. Please see bug 1800810 for background. In short, engagement
telemetry should be based on the result that's visible in the view, not on the
result the provider added last.

D161866 fixed the case where the last-added result is in the view but hidden.
There's another case we need to handle, when the last-added result is not in the
view at all. That can happen when you type something and hit enter really
quickly, before the view can update. I was able to trigger it several times.
When that happens, there are two possibilities:

* No quick suggest result is visible in the view. `result.rowIndex` is its
  initial value of -1, so we record an engagement for a result that is not
  visible and that doesn't have a valid index.

* A quick suggest result from a previous query is visible in the view. Here
  again, `result.rowIndex` is -1 so we record an engagement for a result that is
  not visible and that doesn't have a valid index, and we miss recording an
  engagement for the result that's actually visible.

Right now it's not easy to fix this inside the provider because providers don't
know anything about the view(s). I could record this telemetry in the view but
that's not its role. I think it makes sense to include the view in the query
context, so that's what this does. I added `view.visibleResults` to make getting
the visible results easy.

Daisuke's new Glean telemetry in D160193 uses `context.results`, which has this
same problem of not being based on actually visible results. We'll need to use
`context.view.visibleResults` there too, and there may be other existing cases
as well.

Depends on D161866

Differential Revision: https://phabricator.services.mozilla.com/D162182
2022-11-16 21:47:55 +00:00
trickypr
4b9c23b007 Bug 1510561 - Part 7: Apply plugin:mozilla/require-jsdoc to browser/components/urlbar. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D159472
2022-10-24 13:32:38 +00:00
trickypr
f28fa5aa80 Bug 1510561 - Part 6: Apply plugin:mozilla/valid-jsdoc to browser/components/urlbar. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D159471
2022-10-24 13:32:37 +00:00
Mark Banner
79b9557a71 Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 21:47:50 +00:00
Marian-Vasile Laza
b7f6194b8d Backed out changeset 0679274d6ed5 (bug 1792398) for causing bc failures on browser_sendQuery.js. CLOSED TREE 2022-09-26 22:53:00 +03:00
Mark Banner
5dcae1ed44 Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 18:51:57 +00:00
Narcis Beleuzu
95ae6b7d0f Backed out changeset 849faf753208 (bug 1792398) for bc failures on browser_sendQuery.js . CLOSED TREE 2022-09-26 20:44:40 +03:00
Mark Banner
ff212fab8b Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 16:51:10 +00:00
Mark Banner
89c201a8bd Bug 1780347 - Switch from using importESModule to standard imports for XPCOMUtils in converted system modules. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D152253
2022-07-26 15:11:31 +00:00
Mark Banner
bb995245a0 Bug 1780017 - Load Urlbar providers via importESModule. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D152058
2022-07-26 15:11:30 +00:00
Mark Banner
cd9bed2e7a Bug 1780017 - Migrate urlbar consumers to use ESM imports directly. r=adw,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152057
2022-07-26 15:11:30 +00:00
Mark Banner
52a7ce13c9 Bug 1780017 - Migrate browser/components/urlbar to ESM. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D152056
2022-07-26 15:11:29 +00:00
smolnar
4cb3dcaaa2 Backed out 5 changesets (bug 1780017, bug 1780347) for causing bc failures in browser/base/content/test/performance/browser_preferences_usage.js CLOSED TREE
Backed out changeset 86c3a9142535 (bug 1780347)
Backed out changeset 35abe35417a0 (bug 1780017)
Backed out changeset f448f044f028 (bug 1780017)
Backed out changeset a400cbe83084 (bug 1780017)
Backed out changeset 0a23c9e27f01 (bug 1780017)
2022-07-25 21:00:07 +03:00