Home Contact Sitemap

Firefox中文观察站

您渴望的网络生活就在眼前

隐藏 Firefox 各处右键菜单中的多余项

Firefox 中的很多菜单项目都是平时用不上的, 比如很少有人会在页面上点右键,再选择后退、打印之类的操作吧?再装些扩展,那右键臃肿得不能看了。所以下面我介绍的是如何隐藏页面、书签等地方的右键菜单项目,可以根据自己需要选择性地隐藏它们。

下面的代码格式都是

需要隐藏的项目A,
需要隐藏的项目B,
需要隐藏的项目C
{ display: none !important; }

注意项目之间用半角逗号分隔,最后一个项目后面没有逗号。花括号里的是隐藏命令,!important 表示优先级。下面列出的可隐藏的项目看名字都是一目了然,我就不多解释了。
另外,#context-sep-stop 表示页面右键菜单“停止”下方的分割线,如果你把它上方的东西都隐藏了,当然应该把分割线也一并拿掉。类似的还有书签右键菜单中的 menuseparator。
编辑好需要隐藏的项目之后,把命令添加到 Firefox 的配置目录下这个文件中:
%appdata%MozillaFirefoxProfilesxxxxxxxx.defaultchromeuserChrome.css
如果没有这个文件就新建一个,默认状态下那里会有一个文件叫 userChrome-example.css ,用它另存也行。

隐藏页面右键菜单项:

#context-back,
#context-forward,
#context-reload,
#context-stop,
#context-sep-stop,
#context-bookmarkpage,
#context-savepage,
#context-sendpage,
#context-sep-viewbgimage,
#context-openlink,
#context-sep-open,
#context-bookmarklink,
#context-sendlink,
#context-sep-copyimage,
#context-sendimage,
#context-setWallpaper,
#context-printpage,
#context-smartsearch
{ display: none !important; }

隐藏书签菜单项:

menuitem[label="Bookmark This Page..."],
menuitem[label="Bookmark All Tabs..."],
menuitem[label="Organize Bookmarks..."],
menuitem[label="Organize Bookmarks..."] + menuseparator,
menu[label="Bookmarks Toolbar Folder"]
{ display: none !important; }

隐藏书签项的右键菜单项:

#bookmarks-context-menu menuitem[label="New Bookmark..."],
#bookmarks-context-menu menuitem[label="New Folder..."],
#bookmarks-context-menu menuitem[label="Sort By Name"],
#bookmarks-context-menu menuitem[label="Sort By Name"] + menuseparator,
#bookmarks-context-menu menuitem[label="Open All in Tabs"],
#bookmarks-context-menu menuitem[label="Open All in Tabs"] + menuseparator,
#bookmarks-context-menu menuitem[label="Open"],
#bookmarks-context-menu menuitem[label="Open in New Tab"],
#bookmarks-context-menu menuitem[label="Open in New Tab"] + menuseparator,
#bookmarks-context-menu menuitem[label="New Separator"],
#bookmarks-context-menu menuitem[label="New Separator"] + menuseparator,
#bookmarks-context-menu menuitem[label="Cut"],
#bookmarks-context-menu menuitem[label="Paste"],
#bookmarks-context-menu menuitem[label="Paste"] + menuseparator,
#bookmarks-toolbox #main-menubar
{ display: none !important; }

隐藏书签栏下拉最后的”open in tabs”

.openintabs-menuseparator, .openintabs-menuitem
{ display: none !important; }

隐藏工具栏上的下拉箭头,比如前进后退旁边的:

.toolbarbutton-menubutton-dropmarker
{ display: none !important; }

2007-06-02 08:19:23

该文章还没有评论.

添加评论

* = 必填

:

:


9 + 7 =