开发者

How can I create a page like Add-ons Manager with urlbar and toolbar hidden at Firefox 4 extension?

开发者 https://www.devze.com 2023-02-28 05:17 出处:网络
When browsing the Add-ons Manager, about:addons, in Firefox 4, the toolbars and urlbar are hidden when \"Tabs on Top\" has been set.

When browsing the Add-ons Manager, about:addons, in Firefox 4, the toolbars and urlbar are hidden when "Tabs on Top" has been set.

As I am writing an extension in bootstrappe开发者_Python百科d method, how can I simulate that feature in my own created page?

It has already linked to a page on resource scheme (resource://app/page.html)

I am wonder if there are some "hidden" attributes that can easily do such kind of things.

Or, whether it must hide and show the urlbar and toolbars in listener of window-mediator.

Solutions in XUL method are also welcome :) , but it'd be better if it can easily handle in bootstrap.js. ;-)

Thank you for your help.


It looks like Firefox maintains a whitelist of URL locations that should hide the locationbar chrome. The whitelist is checked here: http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#4412

So, setting the "disablechrome" attribute on the window element should make the locationbar chrome go away. Removing the attribute will make the locationbar chrome come back.

Adding your location the the whitelist would probably be the easiest way to make this work: http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#4086

From your bootstrap.js code, once you get a window, try this:

if (window.XULBrowserWindow)
  window.XULBrowserWindow.inContentWhitelist.push("my-url");
0

精彩评论

暂无评论...
验证码 换一张
取 消