开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜