Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

How do I change the browser address bar upon opening a new tab?

more options

I am writing an extension based on NewTab Override. I would like to know if there is a way to set the browser address bar to have no text when focused, and if so how to do that. So far I am using the code from NewTab Override that does: ``` browser.tabs.update(tabId, { url : url, loadReplace : true }, () => {}); ``` But I don't know any function or property to set for the address bar. I looked in the developer page for Mozilla Firefox but couldn't find anything.

I am writing an extension based on NewTab Override. I would like to know if there is a way to set the browser address bar to have no text when focused, and if so how to do that. So far I am using the code from NewTab Override that does: ``` browser.tabs.update(tabId, { url : url, loadReplace : true }, () => {}); ``` But I don't know any function or property to set for the address bar. I looked in the developer page for Mozilla Firefox but couldn't find anything.

所有回覆 (2)

more options

I found https://searchfox.org/mozilla-central/source/browser/components/extensions/schemas/urlbar.json But I don't know how to use it. It seems to exist in current builds of Firefox but I cannot seem to figure out how to add the urlbar permission without it saying it cannot find it.

more options

Hi Nick, I don't think extensions can change Firefox's behavior for when it shows a URL in the address bar. However, another place to check would be the add-on developer forum:

https://discourse.mozilla.org/c/add-ons/development