分享

Mozilla Firefox : 提示 & 技巧

 jllu_7 2005-09-30

如果您用的系统是 Windows XP 并且想用默认的菜单类型, 把下面的代码加到 userChrome.css 文件:

/* Make menus XP style */
menupopup, popup {
   border: 1px solid ThreeDShadow !important;
   -moz-border-left-colors: ThreeDShadow !important;
   -moz-border-top-colors: ThreeDShadow !important;
   -moz-border-right-colors: ThreeDShadow !important;
   -moz-border-bottom-colors: ThreeDShadow !important;
   padding: 1px !important;
   background-color: Menu !important;
}
menubar > menu {
   border: 1px solid transparent !important;
   padding: 2px 5px 2px 7px !important;
   margin: 0 !important;
}
menubar > menu[_moz-menuactive="true"] {
   background-color : Highlight !important;
   color: HighlightText !important;
}

用经典的windows (9x/Me/2000) 菜单

不幸的是,目前默认的菜单类型是 Windows XP 和原先旧版本 Windows3D 外观的折衷,如果您想要 Windows 经典的外观,把下面的代码加到 userChrome.css 文件:

/* Windows Classic (9x/Me/2000) style Menus */
menupopup, popup {
   border: 2px solid !important;
   -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight;
   -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
   -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
   -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight;
   padding: 1px !important;
}
menubar > menu[disabled="true"] {
   border: 1px solid transparent !important;
}
menubar > menu[_moz-menuactive="true"] {
   border-top: 1px solid ThreeDHighlight !important;
   border-right: 1px solid ThreeDShadow !important;
   border-bottom: 1px solid ThreeDShadow !important;
   border-left: 1px solid ThreeDHighlight !important;
   background-color: transparent !important;
   color: MenuText !important;
}
menubar > menu[_moz-menuactive="true"][open="true"] {
   border-top: 1px solid ThreeDShadow !important;
   border-right: 1px solid ThreeDHighlight !important;
   border-bottom: 1px solid ThreeDHighlight !important;
   border-left: 1px solid ThreeDShadow !important;
}

用自己的图片做工具栏的背景

除了改变主题以外,您页可以用自己的图片做工具栏的背景。  把下面的代码加到 userChrome.css 文件:

/* Use a background image for the toolbars:
(Substitute your image file for background.gif) */

menubar, toolbox, toolbar, .tabbrowser-tabs {
   background-image: url("background.gif") !important;
   background-color: none !important;
}

可以把图片放在 userChrome.css 文件一样的目录下. 图片格式可以是Mozilla Firefox 支持的任意格式。

使动态的标签页更易区分

为了使动态的标签页和已经打开的标签页更易区分开(通过颜色)来把下面的代码加到, userChrome.css 文件:

/* Change color of active tab */
tab[selected="true"] {
   background-color: rgb(222,218,210) !important;
   color: black !important;
}

/* Change color of normal tabs */
tab {
   background-color: rgb(200,196,188) !important;
   color: gray !important;
}

不在动态标签也上使用粗体文本

如果您不想在动态标签页上使用粗体,加下面的代码到  userChrome.css 文件:

/* Make the active tab easier to distinguish: */
tab[selected="true"] {
   font-weight: normal !important;
}

从标签栏删除“关闭”按钮,

您可以把“关闭”按钮从标签栏删除,把下面代码加到  userChrome.css :

/* Remove the close button on the tab bar */
.tabs-closebutton {
   display: none !important;
}

仍然可以关闭标签页,右击标签页选择“关闭标签”或按 Ctrl+W

Remove items from the main menu

有些人为了节省水平空间喜欢把工具栏象菜单一样竖立的放置, 把下面代码加到r userChrome.css :

/* Remove the Go and Help menus */
menu[label="Go"],
menu[label="Help"] {    display: none !important; }

改变窗口图标

Mozilla Firefox 默认没有使用自己图标而是 Mozilla 图标,在一些系统里系统图标被使用,如果您想使用自己图标,遵循下面的方法

  1. 进入您安装 Mozilla Firefox的目录  (如 >C:\Program Files\Firefox\) 下的子目录  chrome.
  2. 建立子目录icons, 在它里面生成子目录 default.
    完整的目录现在是 C:\Program Files\Firefox\chrome\icons\default\
  3. 选择您想使用的图标 (在 Windows 平台用 .ico 文件, 在Linux 平台xpm 文件) 放到这个目录重命名为r and  main-window.[文件类型], e.g. main-window.ico 在 Windows and在linux main-window.xpm

In addition to the main window, you can also change the icon on the Bookmark Manager and JavaScript Console. The icon names are bookmark-window.[filetype] and jsconsoleWindow.[filetype], respectively.

在右边显示侧栏

为了在右边显示侧栏而不是在左边, 把下面代码加到 userChrome.css 文件:

/* Place the sidebar on the right edge of the window */
window > hbox {
   direction:rtl;
}
window > hbox > * {
   direction:ltr;
}

改变搜索条的宽度

搜索条默认相对比较小,您可以自己以特定数量的像素指定它的宽度,下面代码加到 userChrome.css 文件:

/* Make the Search box flex wider */
#search-container {
   -moz-box-flex: 400 !important;
}

? 返回目录


浏览器外观

Open external links in new windows or tabs

如果有外部的程序要在默认的浏览器里打开网页,Mozilla Firefox用一个几经存在的窗口打开它,这意味浏览器可能从一个您正在浏览的页面跳转,如果不希望这发生,加下面的代码到 user.js 文件:

// Stop reusing active windows:
user_pref("advanced.system.supportDDEExec", false);

想打开新标签页而不是窗口怎么办那?What about new tabs instead of windows then? If you prefer tabs instead of windows, 您必须安装Tabbrowser Extensions, 它是一个强有力的标签式浏览的扩展,安装完后按下面的指令来做 

  1. 确保不要忘记把上面的代码加到 user.js 文件.
  2. 选择 工具》选项》扩展, 选择 标签式浏览 单击 设置.
  3. 展开目录列表选择最上面的子目录
  4. 在“窗口”模式下下拉列表,选择“打开时用多个浏览器”

现在外部的程序打开链接时就会在新的标签页打开。

使标签栏一直显示

当只有一个标签页的时候标签栏就会隐藏. 为了使标签栏一直显示, 加下面的代码到r user.js 文件:

// Disable tab bar autohide feature:
user_pref("browser.tabs.autoHide", false);

注意当只有一个标签页时您仍然可以通过单击“关闭” X 隐藏标签栏

取消 target="_blank"

Mozilla Firefox 默认有一个内建的阻止弹出窗口的过滤器,但当用target="_blank"或无效的target="_new"打开新窗口时它停止网页,为了在同一窗口打开链接,加下面的代码到 f user.js 文件:

// disable target="_blank" (open in same window):
user_pref("browser.block.target_new_window", true);

关闭图像自动缩放功能

当这一特性打开时, 它会缩小图像以使比图像小的窗口可以容下图像. 为了关闭这以功能加下面的代码到  user.js 文件:

// Turn off Automatic Image Resizing:
user_pref("browser.enable_automatic_image_resizing", false);

用错误页而不是对话框显示

当联结失败时Mozilla Firefox 默认不是象IE一样显示错误页,而示显示恼人的错误信息,要显示错误页而不是错误信息,加下面的代码到  user.js 文件:

// Instead of annoying error dialog messages, display pages:
user_pref("browser.xul.error_pages.enabled", true);

.

用下载管理器而不是进度窗口

下载文件时, Mozilla Firefox 默认显示进度窗口,如果同时下载多个文件,这些窗口会弄乱您的桌面的,而下载管理器则不会,加下面的代码到 user.js 文件起用下载管理器:

// Instead of download progress windows, use the Sidebar:
user_pref("browser.download.openSidebar", true);
user_pref("browser.download.useProgressDialogs", false);

用好输入查找功能

Find As You Type功能, Mozilla 新介绍的一个新功能, 有一些适合您需要的隐藏功能, 加下面的代码到ruser.js 文件:

// Find As You Type Configuration:
// Set this pref to false to disable Find As You Type:
user_pref("accessibility.typeaheadfind", true);
// If you set this pret to true, typing can automatically start Find As You Type.
// If false (default), you must hit / (find text) or ‘ (find links) before your search.
user_pref("accessibility.typeaheadfind.autostart", true);
// Set this pref to false if you want Find As You Type to search normal text too:
user_pref("accessibility.typeaheadfind.linksonly", true);
// Set this pref to true if you require that the link starts with the entered text:
user_pref("accessibility.typeaheadfind.startlinksonly", false);
// This is the time in milliseconds for the Find As You Type to stop watching for keystrokes:
user_pref("accessibility.typeaheadfind.timeout", 3000);

要了解更多关于 Find As You Type is功能, 查看 documentation.

平滑滚动

Mozilla Firefox 0.6 默认有一个平滑滚动的功能,要打开或关闭这一特性,加下面的代码到 Scrollinguser.js 文件:

// Smooth Scrolling (true = on, false = off):
user_pref("general.smoothScroll", true);

禁止其它 JavaScript 窗口特性

Mozilla Firefox 有一些选项来决定那些scripts可以在窗口使用,这些选项在“工具”》选项》网页特效》高级,这而的选项没有包含全部的特效,还有其它的一些特效可以使用:

// More DOM/JavaScript options

// Make sure all pop-up windows are resizable:
user_pref("dom.disable_window_open_feature.resizable", true);

// Make sure all pop-up windows are minimizable:
user_pref("dom.disable_window_open_feature.minimizable", true);

// Always display the menu in pop-up windows:
user_pref("dom.disable_window_open_feature.menubar", true);

// Always display the Navigation Toolbar in pop-up windows:
user_pref("dom.disable_window_open_feature.location", true);

使用Netscape 6/7 或 Mozilla 书签

如果您正在使用 Netscape 6/7 或 Mozilla, 您可以 使 Mozilla Firefox 使用这些书签. 所有的书签保存在一个名为 bookmarks.html 的文件里,例如,如果您想在 Firefox 里使用Netscape 7的书签,加下面的代码到 user.js 文件:

// Specify which bookmarks file to use:
user_pref("browser.bookmarks.file", "C:\\Path To Netscape Profile\\bookmarks.html");

Remember to use two backslashes for the path separators if you‘re using Windows, e.g. C:\\Path\\bookmarks.html instead of C:\Path\bookmarks.html.

改变地址栏的搜索模式

默认情况下在搜索栏输入关键字按回车,将执行一个B  "I‘m Feeling Lucky" 搜索,如果您想使用标准的搜索模式,加下面的代码到,   user.js 文件:

// Change to normal Google search:
user_pref("keyword.URL", "http://google.com/search?btnG=Google+Search&q=");

当然可以通过改变特定字符串来改变搜索引擎,默认的是: "http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=".

禁止书签图标

您可以禁止书签图标的显示加下面的代码到 user.js 文件:

// Disable Bookmark Icons
user_pref("browser.chrome.site_icons", false);
user_pref("browser.chrome.favicons", false);

改变 throbber URL

当您单击 throbber, 浏览器会联向 www.mozilla.org. 这以网址可以改变,加下面的代码到  user.js 文件:

// Click on throbber to go to Mozilla Firefox Help:
user_pref("browser.throbber.url", "http:///firefox/");

不在地址栏保存 URLs

Mozilla Firefox 允许您输入的地址不出现在地址栏的下拉菜单里面,这可以保护您的隐私,

Andrew Mutch 写了如何作到这些的材料.  见这儿.

?返回目录


网页外观

禁止广告

网站上的广告是恼人的,下面的代码可以阻止大部分的广告,由于这代码较长放到其它页了看,

separate page.

禁止闪烁元素

您也许不想看到上面闪烁的元素. 为了阻止它, 加下面的代码到 user.js 文件:

// Put an end to blinking text!
user_pref("browser.blink_allowed", false);

禁止 <marquee> 标签

一些网站用卷动的标签 . 如果您觉的它没用的话加下面代码来禁止它,加到 userContent.css 文件:

/* Stop those <marquee> tags! */
marquee {
   -moz-binding : none !important;
   display : block;
   height : auto !important;
}

If you added the code, this text should not scroll after restarting Mozilla Firefox.

使框架大小可变

许多网站用框架来显示目录,有时候这些框架太小了. 为了使这些框架大小可变, 加到 user.js 文件:

// Force frames to be resizable
   user_pref("layout.frames.force_resizability", true);

注意有时候它会使您的页面变的比较滑稽:)

修改打开新窗口链接的光标

在打开一个新窗口时,这个提示将改变鼠标当经过链接时,执行一个 JavaScript 命令. 加到 userContent.css 文件:/* Change cursor for links that open in new window */
:link[target="_blank"], :visited[target="_blank"], :link[target="_new"], :visited[target="_new"] {
   cursor: crosshair;
}

修改 JavaScript 链接的光标

这个提示将改变鼠标当经过链接时,执行一个 JavaScript 命令. 加到 userContent.css 文件:

/* Change cursor for JavaScript links */
a[href^="javascript:"] {
   cursor: move;
}

?返回目录


其它提示

改变网页的语言

一些网站提供多国语言的版本,您可以按优先顺序选择语言,要改变优先顺序,您不得不知道各国语言的语言代码如瑞典语代码是sv,下面的例子是user.js里的一个。:

// Change language to Swedish (default is "en, en-us")
user_pref("intl.accept_languages", "sv, en, en-us");

注意: 选项窗口中有一个request 域用于存放此选项。

选择和复制独立的表格单元

当按下Ctrl 健, 您可以选择表格单元. J您页可以选择多个表格单元 一旦选好后您可以象文本一样复制和粘贴您选择的内容 。

加速网页显示

 Mozilla Firefox 默认不显示页面在 250毫秒, 因为它在等待数据. 如果把下面的代码加到  user.js 文件, Mozilla Firefox 立即显示网页, 即使没有完成的数据 它的缺点是在一个慢的机器上由于“回流”使得整个页面的装载时间长了。

// This one makes a huge difference. Last value in milliseconds (default is 250)
user_pref("nglayout.initialpaint.delay", 0);

起用线性管道 Pipelining

Pipelining 是一个实验中的特性, 它设计来提高网页装载效率, 不幸的是不是所有的网站和代理都支持它, servers and想试用它的话加下面的代码到 user.js 文件:

// Enable pipelining:
user_pref("network.http.pipelining", true);
user_pref("network.http.proxy.pipelining", true);
user_pref("network.http.pipelining.maxrequests", 100);

指定保存缓存的位置

为了指定缓存保存在那一个目录, 加代码到 user.js 文件:

// Path to Cache folder:
user_pref("browser.cache.disk.parent_directory","C:\\Path To Cache");

记得用2个斜杠做路径的分割符, i如果您使用 Windows, e.g. C:\\Path To Cache 而不是 C:\Path\Path To Cache.

指定内存缓存的用处,

一般地, Mozilla Firefox 根据有效内存的多少来判断缓存的用处,为了指定特定数量的内存缓存,加代码到 .  user.js 文件:

// Specify the amount of memory cache:
// -1 = determine dynamically (default), 0 = none, n = memory capacity in kilobytes
user_pref("browser.cache.memory.capacity", 4096);

完全禁止内存缓存,用下面的代码,

// Disable memory cache:
user_pref("browser.cache.memory.enable", false);

访问更多的首选项

许多首选项没有在选项窗口体现. 下面的链接显示了原始的首选项窗口, chrome://communicator/content/pref/pref.xul.
Note that many of the preferences in this window will have no effect in Mozilla Firefox, such as the Quick Launch option. Also, this window will most probably be removed completely in future versions of Mozilla Firefox.

Kiosk 浏览

Andrew Mutch 曾经写过关于如何修改firefox使它运行在 kiosk 模式的向导.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多