Initially I probably did this to mimic the search tip on the newtab page
but it's confusing since it's not actually selected.
Differential Revision: https://phabricator.services.mozilla.com/D169176
MAX_OMNIBOX_RESULT_COUNT was introduced in bug 1267810 to increase compatibility with Chromium. It no longer serves this purpose as Chromium has since removed its limit of 6 extension-supplied results.
Differential Revision: https://phabricator.services.mozilla.com/D168891
MAX_OMNIBOX_RESULT_COUNT was introduced in bug 1267810 to increase compatibility with Chromium. It no longer serves this purpose as Chromium has since removed its limit of 6 extension-supplied results.
Differential Revision: https://phabricator.services.mozilla.com/D168891
This adds a new pref, `browser.urlbar.weather.zeroPrefix`. When true, weather
suggestions are shown on "zero prefix" like they are now, which means they're
shown when the user focuses the urlbar and before they type anything. When the
pref is false, the weather provider will show suggestions only if the search
string matches a keyword in a set of keywords managed by `QuickSuggest.weather`.
My plan is to store the keywords in the quick suggest config object in remote
settings. Nan suggested this too. Currently the config does not contain any
keywords, but this patch can be tested by setting the pref to false, running the
following in the browser console, and then typing "weather" in the urlbar:
```lang=js
ChromeUtils.importESModule("resource:///modules/QuickSuggest.sys.mjs")
.QuickSuggest.remoteSettings._test_setConfig({
weather_keywords: ["weather"],
});
```
Other changes:
* It's possible for a keyword to match both the weather suggestion and a quick
suggest suggestion. Only the weather suggestion should be shown. This patch
modifies to the muxer for that.
* This modifies `UrlbarView.#rowLabel()` to show the "Top pick" (a.k.a. best
match) label for keyword-based weather suggestions, in addition to zero-prefix
suggestions like we currently do.
* This modifies the remote settings client so it becomes enabled when keyword-
based weather suggestions are enabled, so that the config can be accessed.
Depends on D168738
Differential Revision: https://phabricator.services.mozilla.com/D168757
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
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.
Differential Revision: https://phabricator.services.mozilla.com/D158587
This is an error in how I implemented the `excludeArgsFromCacheKey` mechanism in
D167318. It can be fixed by always re-caching strings when
`excludeArgsFromCacheKey` is passed to `ensure()`. We could instead store the
argument values of currently cached strings and then re-cache only when
different argument values are passed to `ensure()`, but that would require a
deeper change and I don't think it's worth it.
Differential Revision: https://phabricator.services.mozilla.com/D168509