搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

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