原文来自:Modify Firefox 1.5 to work with all extensions
firefox的插件安装时要判断版本,所以nightly或者新版本安装后经常没办法装插件。有人就发现了这个办法。简单地说,就是在 about:config 中新建 app.extensions.version,值为 1.0 ,装好之后改回去也可以用。判断版本应该是为了稳定性考虑,这样做可能会导致一些问题,谁知道呢…
For all of those who just downloaded Firefox 1.5 and can’t get your extensions to work. This is a simple modification of Firefox’s configuration to trick the extensions to work. No need to manually edit the extensions to get them to work. Currently all the extensions I use work except the bookmark sync extension that I so dearly want to.
1. At the location bar, enter: about:config. This will show you a list of Firefox internal preferences.
2. Right-click on the list, select New > String
Enter “app.extensions.version” (without quotes) for the preference name.
3. Then, enter “1.0” (without quotes) as the value for app.extensions.version.
4. Restart Firefox 1.5, then enable those disabled Firefox extensions.
5. Restart Firefox 1.5 again to active the extensions. Done.
Personally I think this is the best solution because you can always go back and delete the string later rather then fiddling with the extensions.
[UPDATE]
if you change 1.0 back to 1.5 Spoofstick [and potentially others] will continue to work and can also look for updates.
相关资料:
Top 10 custom JavaScript functions of all time
酷极了,主要就是把firefox和ie不同的部分合二为一。还有一些啰里啰唆的常用功能代码也先定义好函数…
原文来自:风微柳细
原来的方法是用个大中文字数组,一个个比较,:(
以下为引用内容:
更新[2005.10.06]:JavaScript提供了一种更简便的方法用于比较两个字符串——localeCompare(),localeCompare()使用本地特定的顺序来比较两个字符串,语法如下:
string.localeCompare(target)
参数target是要与string进行比较的字符串。
如果string小于target,则localeCompare()返回小于0的数;
如果string大于target,返回大于0的数;
如果相等(或按照本地顺序的约定两者顺序相当),则返回0。
利用该方法替换上面冗长的作法后,除了代码减少了之外,运行速度也快了不少,而且还支持其它字符库的本地排序。
修改后代码如下:
该方法目前已作为ECMAScript v3标准,在支持JavaScript 1.5(Mozilla、Netscape 6+)以及JScript 5.5(IE 5.5+)的浏览器中均得到了支持。
包含汉字的字符串数组(用逗号”,”隔开):
默认排序结果:
汉字拼音顺序排序结果:
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]