Closed Bug 1797801 Opened 3 years ago Closed 2 years ago

Using a one-off engine that coincides with the default engine will result in the one-off button not getting cleared in the Urlbar when showSearchTerms is enabled

Categories

(Firefox :: Address Bar, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jteow, Unassigned)

References

(Blocks 1 open bug)

Details

STR:

  1. Enable showSearchTerms feature so that search terms are in the Urlbar.
  2. Do a search with a one-off engine that is the same as the default engine from the Urlbar.

Expected:
The button that shows the one-off engine should be cleared from the URL bar.

Actual:
The button that shows the one-off engine remains in the URL bar.

Summary: Using a one-off engine that coincides with the default engine will result in the one-off button not getting cleared in the Urlbar → Using a one-off engine that coincides with the default engine will result in the one-off button not getting cleared in the Urlbar when showSearchTerms is enabled

I think this is because setURI resets search mode by evaluating whether the page is valid or not. Since we're loading a page that will have a userTypedValue, it is no longer considered valid.

We don't currently have a way of knowing whether it's the loading setURI due to an onLocationChange event that's a result of a page load, or if it's swapping back to the tab.

We do however know that aRequest will come through onLocationChange in browser.js before calling setURI. And a website does a push event, it's won't have a request. Likewise returning to a tab from another tab (thus, it won't disrupt a search mode in progress).

So we could pass an input variable to setURI that indicates whether the caller has a request or not. I don't think we need to pass the aRequest object itself since it's values are irrelevant to the context of setURI It probably makes sense for the search mode indicator to always get nulled when a request is present.

At this point, it might make sense to refactor the input of setURI into an object.

This should no longer be the case due to Bug 1818848 because upon page load, the pageproxystate will be valid (which removes the search mode button).

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.