Closed Bug 1569812 Opened 1 year ago Closed 1 year ago

Allow extensions to specify search engines by name, URL, or alias

Categories

(Firefox :: Address Bar, task, P1)

task
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 70
Iteration:
70.2 - Jul 22 - Aug 4
Tracking Status
firefox69 + fixed
firefox70 + fixed

People

(Reporter: adw, Assigned: adw)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

UrlbarResult objects for search results have a required payload.engine property, the name of the engine, but extensions won't always know the name Firefox uses internally or even any name at all. For example, the top sites API returns search results with aliases but not names. We should let extensions specify engine URLs and aliases, and we can use them to look up the engine name.

UrlbarResult objects for search results have a payload.engine property, the name of the engine, but extensions won't always know the name Firefox uses internally or even any name at all. For example, the top sites API returns search results with aliases but not names. We should let extensions specify engine URLs and aliases, and we can use them to look up the engine name.

The UrlbarResult.jsm change is unrelated but fixes a minor annoyance I found while working on the top-sites extension. My background script returns results with isKeywordOffer: true, but that causes an error in UrlbarResult.payloadAndSimpleHighlights because it converts string values to arrays and then expects non-string values to be arrays. Instead, it should be converting non-array values to arrays.

I just realized that the top sites spec says that results should be styled as bookmarks and switch-to-tabs as appropriate, and we don't get that for free... So we'll have to add more logic to _makeUrlbarResult I guess that looks up each result in bookmarks and the open-page table...?

Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cba45d4e8def
Quantumbar: Allow extensions to specify search engines by name, URL, or alias. r=mak
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Flags: qe-verify-
Flags: in-testsuite+
Attached patch Beta/69 patchSplinter Review

Beta/Release Uplift Approval Request

  • User impact if declined: This bug supports the top-sites experiment that the quantumbar/search team would like to conduct on 69.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This is a change to the internals of the part of the urlbar that deals with extensions. There's no risk that this affects anything else. The urlbar extension API is for privileged Mozilla extensions only.
  • String changes made/needed: None
Attachment #9082444 - Flags: approval-mozilla-beta?
Comment on attachment 9082444 [details] [diff] [review]
Beta/69 patch

Patch needed to support experiments being run on Fx69. Includes automated tests. Approved for 69.0b11.
Attachment #9082444 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.