tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 792a8cf8b786f909d983351437bba5a6acf4604c
parent c78b1f62b6378f02ed007667d88271c1772e0501
Author: Daisuke Akatsuka <daisuke@birchill.co.jp>
Date:   Thu, 11 Dec 2025 01:12:04 +0000

Bug 1995227: Make tags higilights calculation lazily r=adw

Differential Revision: https://phabricator.services.mozilla.com/D274562

Diffstat:
Mbrowser/components/urlbar/UrlbarView.sys.mjs | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/browser/components/urlbar/UrlbarView.sys.mjs b/browser/components/urlbar/UrlbarView.sys.mjs @@ -2115,15 +2115,23 @@ export class UrlbarView { let tagsContainer = item._elements.get("tagsContainer"); if (tagsContainer) { tagsContainer.textContent = ""; - if (result.payload.tags && result.payload.tags.length) { + + let { value: tags, highlights } = result.getDisplayableValueAndHighlights( + "tags", + { + tokens: this.#queryContext.tokens, + } + ); + + if (tags?.length) { tagsContainer.append( - ...result.payload.tags.map((tag, i) => { + ...tags.map((tag, i) => { const element = this.#createElement("span"); element.className = "urlbarView-tag"; lazy.UrlbarUtils.addTextContentWithHighlights( element, tag, - result.payloadHighlights.tags[i] + highlights[i] ); return element; })