Posts Tagged ‘firefox’

‘JavaScript component does not have a method named: “onLocationChange”‘ when calling method: [nsIWebProgressListener::onLocationChange]“

在项目中使用jsTree,在firefox的js控制台输出以下错误:

[Exception... "'JavaScript component does not have a method named:
"onLocationChange"' when calling method:
[nsIWebProgressListener::onLocationChange]"  nsresult: "0x80570030
(NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "JS frame ::
file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js
:: sss_observe :: line 320"  data: no]
file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js
Line 320

[Exception... "'JavaScript component does not have a method named:
"onLocationChange"' when calling method:
[nsIWebProgressListener::onLocationChange]"  nsresult: "0x80570030
(NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "<unknown>"
data: no]

参考此文 此文 此文 还有此文得知是firebug和flashgot扩展到冲突造成的,把flashgot禁用或者卸载掉就可以了。

 

Firebug : console is not defined

今天在公司没事干,公司产品的代码读了个大概50%。

打算将这个系统的人员组织结构树用jquery.treeview这个插件来实现,所以正在熟悉这个插件。

调试调用这个插件:

1
2
3
4
5
6
    $(document).ready(function(){
        $("#browser").treeview({
            toggle: function() {
                console.log("%s was toggled.", $(this).find(">span").text());
            }
        });

F5刷新,点任意树状节点,Web Developer扩展里面出现一个javascript错误:

console is not defined

google了一下发现console是firebug提供了一个用于js调试的对象,除了log,还提供了很多其他的方法。

难怪Web Developer无法识别console是嘛东东。

直接打开firebug查看调试信息,Web Developer的错误信息可以不用理会,firebug太tmd强大了。

firebug console output

 

iceweasel[firefox]的kde4主题:KFirefox

才安装好kde4.3,发现iceweasel(也就是firefox)的默认主题十分的丑陋,或许是因为我用的是kde桌面环境,而firefox for linux是用gtk+开发,于是乎发现了个仿kde4的主题:KFirefox , 主页和下载地址:http://ramonantonio.net/kde-firefox/

对比一下安装前后:

安装前:

before-firefox-theme-kde43

安装后:

firefox-theme-kde43

 

Firefox 无法将文件安装至 http://xxxx原因为: 不预期的安装错误 详情请查看错误控制台日志。 -203

前几天安装了win7,在安装之前把firefox的资料都用mozbackup备份了一次,然后安装好了后还原,问题就来了。cookie,密码,缓存都正常,就是扩展里面一片空白,于是心想估计是丢了,无所谓就重新下载,结果安装任何的扩展都出现这样的错误:

Firefox 无法将文件安装至 http://xxxx原因为: 不预期的安装错误 详情请查看错误控制台日志。 -203

google了,也有人出现这样的问题,但是没有明确的解决方法,最后在http://kb.mozillazine.org/Unable_to_install_themes_or_extensions_-_Firefox找到了答案。里面列出了所有的出现无法安装卸载扩展的原因和解决方案,用查找搜索“203”定位到这里:

Corrupt extension files

Files that store information about the extensions you have installed can sometimes be corrupted. Deleting them can fix a number of extension issues; they will be regenerated the next time you start Firefox. [17][18]. Exit Firefox completely, then open your Firefox profile folder (read the linked article for its location) and delete* these three files:

extensions.ini
extensions.cache
extensions.rdf
  • Note : Although unwanted files/folders can be deleted, renaming them is generally considered a safer option. This achieves the same result, but allows the user to retrieve any possibly required information from them later on. In the case above, rename the above 3 files as , ‘extensionsOLD.ini’, ‘extensionsOLD.cache’, ‘extensionsOLD.rdf’

Unexpected installation error -203

Installing themes or extensions may fail with the message, Unexpected installation error -203. (If this occurs after a Software Update you may find that add-ons that were previously installed also do not work.) Follow the above directions to remove corrupt extension files. [19] If the problem is not resolved and you use ZoneAlarm or CA Firewall, disable it temporarily (enable Windows Firewall in the interim) to allow the installation. [20] If the problem persists, your profile may be corrupt (bug 361358). Use the Profile Manager to create a new profile [21] or create a new default profile [22] and then transfer your data to the newly-created profile.

——————————-

搞了半天结果是扩展损坏造成的,解决方法是:删除 C:\Users\tun\AppData\Roaming\Mozilla\Firefox\Profiles\3neukyyj.default (win7系统是这个目录,找不到这些文件,用windows搜索。)目录下的extensions.ini extensions.cache extensions.rdf 这3个文件,当然最好是备份,免得数据丢失。删除后这3个文件重新生成,也就是说里面关于扩展的记录都消失了,全部扩展需要重新安装。

 

自定义Firefox默认缓存目录

默认情况下Firefox的缓存目录和Firefox安装目录在同一磁盘。Windows系统默认存放在Documents and Settings文件夹。在缓存放到一个更快的硬盘上是一个不错的想法。并不是说存放在固态硬盘上Firefox就可以提高速度,因为一般情况下固态硬盘读数据快,但是写如数据比较慢。

移动Firefox默认缓存的主要目的是提高性能和安全性。我们可以把缓存移动到一个加密的分区,或者一个可移动磁盘上。

在Firefox的设置中是没有调整缓存的选项。我们只有在about:config中加入一个新的参数。

在Firefox地址栏中输入about:config :

右键选择“新建”->”字符串”,输入

1
browser.cache.disk.parent_directory作为"首选项名称",字符串输入你想转移的路径,比如c:\temp

Opera用户可以直接地址栏输入 opera:config#UserPrefs|CacheDirectory4 然后修改路径。

IE用户可以在工具->Internet选项->常规->设置->移动文件夹 中搞定~

Via ghacks

—-

ps:重修考试之《电工学(Electronic Engineering)》续挂~囧

 

任意改变 Firefox 窗口背景色的扩展 AnyColor

这些天发现好多同学在论坛上询问如何修改 FF 默认主题背景色的方法,的确很多时候我们需要的仅仅是修改一下主题的颜色,
不一定每个人都喜欢花哨的主题。

有一个目前还在测试中的扩展 AnyColor 可以轻松的修改 FF 窗口的背景色。
AnyColorb 实际上借鉴了 Personas 的工作原理,
修改完颜色之后不需要浏览器就可以看到效果。

在 AnyColor 的设置选项中甚至还内置了几个默认的风格,
大家可以尝试一下。其实这几个风格都是在 Personas 的在线主题资源中出镜率比较高的作品。
大家也可以利用这个扩展,将 FF 的工具栏背景更换成自己喜欢的位图,不需要复杂的 CSS 修改,
只需要在扩展的设置选项里猛击几下就可以搞定了。 Read the rest of this entry »