Closed Bug 1608601 Opened 6 years ago Closed 6 years ago

[Nudges] Urlbar input isn't cleared after clicking the redirect tip's "Okay, Got It" button

Categories

(Firefox :: Address Bar, defect, P1)

defect
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 74
Iteration:
74.1 - Jan 6 - Jan 19
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- wontfix
firefox73 --- fixed
firefox74 --- fixed

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(1 file)

This is a last-minute nudges/tips bug that Harry found today. It's a problem on 72 and later versions. I don't think it's a show stopper -- we could ship the extension with it -- but I also think we should fix it. We should able to do it entirely from the add-on without landing any production code in m-c, but it will require an experiment API addition.

When the redirect tip is shown (for example on google.com), the input correctly is empty, but when you then click the tip's "Okay, Got It" button, the input's value is set to the page's URL. So you have to clear the input before you can search. It should remain empty when you click the button.

Harry found this while porting the extension in bug 1606909. The value is set to the URL by the handleRevert call here: https://searchfox.org/mozilla-central/rev/d4d6f81e0ab479cde192453bae83d5e3edfb39d6/browser/components/urlbar/UrlbarInput.jsm#615

The stack is:

_setValue (UrlbarInput.jsm#1076)
value (UrlbarInput.jsm#941)
URLBarSetURI (browser.js#3390)
handleRevert (UrlbarInput.jsm#434)
pickElement (UrlbarInput.jsm#615)
_on_mouseup (UrlbarView.jsm#1424)
handleEvent (UrlbarView.jsm#499)
See Also: → 1608613

We need to also set the pageproxystate to invalid so that we show the magnifying glass icon in the input instead of the lock and shield.

This is used in the extension's background script here: https://github.com/0c0w3/urlbar-tips-experiment/pull/8/files#diff-961641dd6af66f5e3313307cf4eb8f1dR339 (Bug 1608613 tracks that PR)

Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/119cd111d7d4 Add browser.experiments.urlbar.clearInput() experiment API. r=harry
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 74
Flags: qe-verify-
Flags: in-testsuite+

Comment on attachment 9120233 [details]
Bug 1608601 - Add browser.experiments.urlbar.clearInput() experiment API.

Beta/Release Uplift Approval Request

  • User impact if declined: No user impact. This patch only adds a test. I'm requesting uplift because it's a test related to a urlbar experiment that we're running on 72, 73, and 74, so it would be good to have test coverage on 73 (and 72, but that ship has sailed).
  • 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 only a test
  • String changes made/needed:
Attachment #9120233 - Flags: approval-mozilla-beta?

Comment on attachment 9120233 [details]
Bug 1608601 - Add browser.experiments.urlbar.clearInput() experiment API.

Test-only change. Approved for 73.0b5.

Attachment #9120233 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: