当用新的标签页替换插件打开一个新的标签时,如何保持地址栏清晰? [英] When opening a new tab with a new tab page replacement add-on, how to keep the address bar clear?

查看:130
本文介绍了当用新的标签页替换插件打开一个新的标签时,如何保持地址栏清晰?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Firefox开发一个新的标签页替换插件。安装后,当我点击新的标签图标打开一个新的标签,新的标签打开罚款,但地址栏显示一个凌乱的URL:
资源:// firefox_p-at-getblog-dot-com / getblog_buttons_page / data / newtab.html



如何使地址栏变空?

解决方案

只有一个



现在,您有几个选择:


I'm developing a new tab page replacement add-on for Firefox. After it's installed, when I click the new tab icon to open a new tab, the new tab opens fine, but the address bar shows a messy URL: resource://firefox_p-at-getblog-dot-com/getblog_buttons_page/data/newtab.html

How do I make the address bar empty?

解决方案

There are only a few pages that will have "blank" uris in the URI bar.

Now, you have a couple of options:

  • Overlay/inject into browser.xul and just add your add-on URI to gInitialPages Or combine the about module and gInitialPages stuff.
  • Implement an about module like @canuckistani suggests. While this will still display an URI, it will be a much nicer one. ;)
  • Or, as a last resort, override about:newTab. This can (will?) have side-effects, however, like other add-ons still overlaying about:newTab which now happens to be the new page from your add-on, which might or might not work at all and/or break stuff.

这篇关于当用新的标签页替换插件打开一个新的标签时,如何保持地址栏清晰?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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