隐藏Firefox的加载项的位置栏 [英] Hide location bar from firefox add-on

查看:137
本文介绍了隐藏Firefox的加载项的位置栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的插件中,我有一个HTML页面,在安装/更新时显示。 Firefox明显地显示了页面的chrome:// URI,我试图弄清楚如何防止这种情况发生(仅仅出于美学的原因,请介意你...)。

In my add-on I have an HTML page that gets displayed upon install/update. Firefox obviously shows the chrome:// URI of the page, and I was trying to figure out how to prevent that from happening (just for aesthetic reasons, mind you...).

我知道一些加载项能够隐藏某些标签/页面上的位置栏:他们是怎么做到的?

I know that some add-ons are able to hide the location bar on certain tabs/pages: how do they do that?

f41df039db03 / browser / base / content / browser.js#l4146rel =nofollow> http://hg.mozilla.org/mozilla-central/file/f41df039db03/browser/base/content/browser.js#l4146 。如果你有一个浏览器覆盖,你应该可以添加自己的URL到列表:

Firefox has a list with URLs where it hides the location bar: http://hg.mozilla.org/mozilla-central/file/f41df039db03/browser/base/content/browser.js#l4146. If you have a browser overlay you should be able to add your own URL to that list:

if (typeof XULBrowserWindow == "object" && XULBrowserWindow.inContentWhitelist instanceof Array)
  XULBrowserWindow.inContentWhitelist.push("chrome://...");

这些检查旨在确保在Firefox代码发生变化时不会做任何错误未来的版本。

The checks are meant to ensure that you don't do anything wrong if the Firefox code changes in some future version.

这篇关于隐藏Firefox的加载项的位置栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆