地址栏¶
本文档描述了 Firefox 地址栏的实现,也称为 quantumbar 或 urlbar。在 Firefox 68 之前,地址栏也被称为 awesomebar,后来进行了大幅重写。
地址栏是一个专门的搜索访问点,它聚合来自多个不同来源的数据,包括
书签与历史记录 (Firefox 的历史记录和书签系统)
搜索引擎 (包括搜索建议)
WebExtensions
打开的标签页
从哪里开始¶
如果您想了解地址栏工作原理的高级非技术总结,请阅读 非技术概述。
如果您对技术细节感兴趣,您可能希望跳到 架构概述。
代码库¶
地址栏代码位于 browser/components/urlbar。
目录¶
- 非技术概述
- 架构概述
- 搜索生命周期
- 实用工具
- 遥测
- 直方图
- 标量
- urlbar.abandonment
- urlbar.autofill_deletion
- urlbar.engagement
- urlbar.impression.*
- urlbar.persistedsearchterms.revert_by_popup_count
- urlbar.persistedsearchterms.view_count
- urlbar.tips
- urlbar.searchmode.*
- urlbar.picked.*
- urlbar.picked.searchmode.*
- urlbar.tabtosearch.*
- urlbar.zeroprefix.abandonment
- urlbar.zeroprefix.engagement
- urlbar.zeroprefix.exposure
- urlbar.quickaction.impression
- urlbar.quickaction.picked
- places.*
- 搜索参与度遥测
- 上下文服务的自定义 Ping
- 其他与地址栏相关的遥测
- Firefox Suggest 遥测
- 直方图
- 标量
- browser.ui.interaction.preferences_panePrivacy
- contextual.services.quicksuggest.block_dynamic_wikipedia
- contextual.services.quicksuggest.block_nonsponsored
- contextual.services.quicksuggest.block_nonsponsored_bestmatch
- contextual.services.quicksuggest.block_sponsored
- contextual.services.quicksuggest.block_sponsored_bestmatch
- contextual.services.quicksuggest.block_weather
- contextual.services.quicksuggest.click
- contextual.services.quicksuggest.click_dynamic_wikipedia
- contextual.services.quicksuggest.click_nav_notmatched
- contextual.services.quicksuggest.click_nav_shown_heuristic
- contextual.services.quicksuggest.click_nav_shown_nav
- contextual.services.quicksuggest.click_nav_superceded
- contextual.services.quicksuggest.click_nonsponsored
- contextual.services.quicksuggest.click_nonsponsored_bestmatch
- contextual.services.quicksuggest.click_sponsored
- contextual.services.quicksuggest.click_sponsored_bestmatch
- contextual.services.quicksuggest.click_weather
- contextual.services.quicksuggest.exposure_weather
- contextual.services.quicksuggest.help
- contextual.services.quicksuggest.help_dynamic_wikipedia
- contextual.services.quicksuggest.help_nonsponsored
- contextual.services.quicksuggest.help_nonsponsored_bestmatch
- contextual.services.quicksuggest.help_sponsored
- contextual.services.quicksuggest.help_sponsored_bestmatch
- contextual.services.quicksuggest.help_weather
- contextual.services.quicksuggest.impression
- contextual.services.quicksuggest.impression_dynamic_wikipedia
- contextual.services.quicksuggest.impression_nav_notmatched
- contextual.services.quicksuggest.impression_nav_shown
- contextual.services.quicksuggest.impression_nav_superceded
- contextual.services.quicksuggest.impression_nonsponsored
- contextual.services.quicksuggest.impression_nonsponsored_bestmatch
- contextual.services.quicksuggest.impression_sponsored
- contextual.services.quicksuggest.impression_sponsored_bestmatch
- contextual.services.quicksuggest.impression_weather
- 事件
- 环境
- “quick-suggest” Ping
- Nimbus 曝光事件
- Merino 搜索查询
- 调试与日志
- 排名
- 动态结果类型
- 偏好设置
- 测试
- 联系我们
API 参考¶
- UrlbarController 参考
UrlbarControllerUrlbarController.UrlbarControllerUrlbarController.userSelectionBehaviorUrlbarController.addQueryListener()UrlbarController.cancelQuery()UrlbarController.clearLastQueryContextCache()UrlbarController.handleKeyNavigation()UrlbarController.keyEventMovesCaret()UrlbarController.notify()UrlbarController.receiveResults()UrlbarController.recordSelectedResult()UrlbarController.removeQueryListener()UrlbarController.removeResult()UrlbarController.setLastQueryContextCache()UrlbarController.setView()UrlbarController.speculativeConnect()UrlbarController.startQuery()
- UrlbarInput 参考
UrlbarInputUrlbarInput.UrlbarInputUrlbarInput._autofillFirstResult()UrlbarInput._autofillValue()UrlbarInput._loadURL()UrlbarInput._maybeAutofillPlaceholder()UrlbarInput._maybeCanonizeURL()UrlbarInput._maybeSelectAll()UrlbarInput._notifyStartNavigation()UrlbarInput._recordSearch()UrlbarInput._resetSearchState()UrlbarInput._searchModeForResult()UrlbarInput._setValue()UrlbarInput._trimValue()UrlbarInput._updateSearchModeUI()UrlbarInput._whereToOpen()UrlbarInput.afterTabSwitchFocusChange()UrlbarInput.confirmSearchMode()UrlbarInput.formatValue()UrlbarInput.getSearchMode()UrlbarInput.getSearchSource()UrlbarInput.handleCommand()UrlbarInput.handleEvent()UrlbarInput.handleNavigation()UrlbarInput.handoff()UrlbarInput.makeURIReadable()UrlbarInput.maybeConfirmSearchModeFromResult()UrlbarInput.onFirstResult()UrlbarInput.pickElement()UrlbarInput.pickResult()UrlbarInput.removeHiddenFocus()UrlbarInput.restoreSearchModeState()UrlbarInput.sanitizeTextFromClipboard()UrlbarInput.search()UrlbarInput.searchModeShortcut()UrlbarInput.setHiddenFocus()UrlbarInput.setPageProxyState()UrlbarInput.setResultForCurrentValue()UrlbarInput.setSearchMode()UrlbarInput.setURI()UrlbarInput.setValueFromResult()UrlbarInput.startQuery()UrlbarInput.updateTextOverflow()
- UrlbarView 参考
UrlbarViewUrlbarView.UrlbarViewUrlbarView.isOpenUrlbarView.selectedElementUrlbarView.selectedResultUrlbarView.visibleRowCountUrlbarView.autoOpen()UrlbarView.clearSelection()UrlbarView.close()UrlbarView.getFirstSelectableElement()UrlbarView.getLastSelectableElement()UrlbarView.getResultAtIndex()UrlbarView.getResultFromElement()UrlbarView.handleEvent()UrlbarView.hideTemporarily()UrlbarView.invalidateResultMenuCommands()UrlbarView.onQueryResultRemoved()UrlbarView.restoreVisibility()UrlbarView.resultIsSelected()UrlbarView.selectBy()UrlbarView.shouldSpaceActivateSelectedElement()UrlbarView.addDynamicViewTemplateUrlbarView.removeDynamicViewTemplate