officeba > 单独文章


技巧分享:火狐浏览器Firefox的配置文件

关于Firefox的许多技巧都需要您来编辑Mozilla Firefox的配置文件.这里面有三个配置文件您应当知道的:

  user.js - 用来改变各种选项.
  userChrome.css - 用 来改变浏览器的外观.
  userContent.css - 用来改变网页的外观.

    所有的这些文件都纯文本文件,存储在您的配置文件夹里面,并可以使用任何一个标准的编辑器来编辑它们,比如:windows系统中的记事本或者Texturizer和Linux系统中的gedit或者kate

  配置文件夹

  在开始配置您的文件之前,您应当知道怎么找到通常称为"配置文件夹".配置文件夹是位于您硬盘中某处,供 Mozilla Firefox 存放您的所有个人设置的地方.

  在Windows 95/98/Me的系统里,这个文件夹的路径通常是:C:/WINDOWS/Application Data/Phoenix/Profiles/default/xxxxxxxx.slt/,这里 xxxxxxxx是一个8位的随机数. 打开C:/WINDOWS/Application Data/Phoenix/Profiles/这个文件夹浏览就行了,其他的东西则是一目了然了.

  在Windows 2000/XP系统中,这个路径通常是:%AppData%/Phoenix/Profiles/default/xxxxxxxx.slt/.

  在Linux系统下,路径是:~/.phoenix/default/xxxxxxxx.slt.

  在MacOS X系统下,路径是:~/Library/Phoenix/Profiles/default/xxxxxxxx.slt.

  注意: Mozilla Firefox允许不只一个用户,当然也不只一个配置文件了.上面例子中的路径指的是默认的配置文件,这个文件在您第一次起动Mozilla Firefox时,由它自动创建. 使用配置文件管理器您可管理任意多的配置文件.

  在windows 2000/XP 系统下,变量 %AppData%是一个对Application Data路径的简记形式. 使用这个变量的时候,仅仅需要在资源管理器的地址栏中输入 %AppData%然后按Enter就可以了. 您会被代到真正的文件夹下,一般情况下可能是: C:/Documents and Settings/[User Name]/Application Data.

  user.js

  这个文件是Mozilla Firefox的一个主要配置文件,位于您配置文件夹里. 默认的情况这个文件并不存在,那么您必需在您加入您的配置之前创建它.

  Windows 用户:如果您知道如何创建一个文件,就跳过一节.在您创建文件之前,您必要确认一下,您可以看到文件的扩展名.起动资源管理器(点击桌面上的我的电脑的图标)然后选择: 文件 > 工具 > 文件夹选项.... 点击查看标签页,然后取消隐藏已知文件类型的扩展名选项. 现在,回到您的配置文件夹,然后选择文件 > 新建 > 文本文件. 默认的名字是新建文本文件.txt的文件出现了.把名字改成user.js (当警告框出现的时候点击确定).

  Linux 用户: 如果您正在使用Linux系统,我假定您是知道如果创建一个新文件的.在您的配置文件夹内创建一个文件名为 user.js.

  您可以通过在地址栏中输入about:configEnter来进入编辑保存在user.js中的参数选项.您会在Mozilla Firefox中看到一个所有的可用参数选项的列表(大部分是从Mozilla那里引入,其中有一些并没有使用也没有被移除) .双击一个参数选项来改变它的值.您做的改变会立即保存在由Mozilla Firefox自动创建的文件prefs.js中.

  userChrome.css

  这个文件用来设置在Mozilla Firefox用户界面上的各个元素的显示规则,文件位置您的配置文件夹下一个名字叫chrome的子文件夹里. 和user.js文件一样,这个文件默认情况下并不存在, 您也要在加入您的选项之前创建它.不过默认的情况下是存在一个例子文件的,名字叫 userChrome-example.css. 基本上,您是可能把这个文件重命名一下就行了,也就是删去后面的-example部分.

  userContent.css

  这个文件用来设置网页内容的显示规则,它也位置配置文件夹下的chrome的子文件夹里.默认时和user.js文件一样,这个文件 并不存在 在您设置您的选项之前您要创建它.和userChrome.css文件一样,默认情况下,有一个例子文件叫userContent-example.css. 基本上您就重命名一个这个文件则可,也就是删去后面的-example部分.
    提示 & 技巧

  以下包含的各种技巧,大部分要编辑配置文件,如果您不熟悉基本的文件,文件夹用法,建议您不要修改,这一页按技巧的重要性排列,分为4个部分

    浏览器外观

  用 W indows XP 菜单

  如果您用的系统是 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 imag e 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 图标,在一些系统里系统图标被使用,如果您想使用自己图标,遵循下面的方法

  进入您安装 Mozilla F irefox的目录 (如 >C:/Program Files/Firefox/) 下的子目录 chrome.

  建立子目录icons, 在它里面生成子目录 default.
  完整的目录现在是 C:/Program Files/Firefox/chrome/icons/default/
  选择您想使用的图标 (在 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, 它是一个强有力的标签式浏览的扩展,安装完后按下面的指令来做

  确保不要忘记把上面的代码加到 user.js 文件.

  选择 工具》选项》扩展, 选择 标签式浏览 单击 设置.

  展开目录列表选择最上面的子目录

  在“窗口”模式下下拉列表,选择“打开时用多个浏览器”

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

    使标签栏一直显示

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

// Disable tab bar autohide feat ure:
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);

    平滑滚动

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

// Smooth Scroll ing (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", https://google.com/search?btnG=Google+Search&q=);

  当然可以通过改变特定字符串来改变搜索引擎,默认的是: "https://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 o n throbber to go to Mozilla Firefox Help:
user_pref("browser.throbber.url", "https://www.googlezq.com/");
不在地址栏保存 URLs

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

    网页外观

    禁止广告

  网站上的广告是恼人的,下面的代码可以阻止大部分的广告,由于这代码较长放到其它页了看,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 curso r 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.  Dell
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.


声明:欢迎各大网站转载本站文章,还请保留一条能直接指向本站的超级链接,谢谢!

时间:2007-05-08 23:15:46,点击:65824


【OfficeBa论坛】:阅读本文时遇到了什么问题,可以到论坛进行交流!Excel专家邮件:342327115@qq.com(大家在Excel使用中遇到什么问题,可以咨询此邮箱)。

【声明】:以上文章或资料除注明为Office自创或编辑整理外,均为各方收集或网友推荐所得。其中摘录的内容以共享、研究为目的,不存在任何商业考虑。如有任何异议,请与本站联系,本站确认后将立即撤下。谢谢您的支持与理解!


相关评论

我要评论

评论内容