Where Firefox defines words entered in URL bar to be converted to search

I am trying to find an area in Firefox source where after the user presses Enter, the words typed in the url bar are identified to be loaded into the default search engine. So, for example, if I type firefox

, it pulls in the search results. I cannot find where this logic is going.

I tracked it down like this, starting with what brings up the search bar to get in and then going deeper, tracking down the url and any other uri that was passed along the way.

  • gURLBar.handleCommand
  • openUILinkIn
  • openLinkIn
  • gBrowser.loadURIWithFlags

So modding the openLinkIn function to make the console.log up loadURIWithFlags

, we can see that url is still the search term up to that point.

  1. gBrowser.mCurrentBrowser.loadURIWithFlags
  2. _loadURIWithFlags
  3. gBrowser.webNavigation.loadURIWithOptions → [[native code]

So I follow through typing into this function and I find right before it calls native code, it passes uri which is still a search term, it is mind-boggling, I was thinking at this point (before going to native code ) it would compute the default search engine submit url and then pass it. Did I miss something?

+3


source to share


1 answer


No, I think your analysis is correct - the browser is actually iterating over the URL with the search keywords. And then the content process sends the Browser: URIFixup message that is received in the browser .js again and runs the function gKeywordURIFixup

. Then when the keywords are allowed. Yes, things used to be a lot easier before Mozilla started working on process separation.



+1


source







All Articles