升级到firefox 3.5之后,Google Account Multi-Login 就不能切换用户了。去主页看了一下,也没有新版本可以更新。
检查了一下脚本,发现自第83行开始的这几行出了问题
this.parentNode.Email.value = un;
...
貌似firefox 3.5那备受好评的新Javascript引擎没办法识别form.field_name这种用法。Firebug的错误提示显示:this.parentNode.Email is undefined
于是做了一点修改,你可以直接点这里安装修改过的版本:install Google Account Multi-Login script for Firefox 3.5。
如果你要自己动手的话,首先你需要打开google_account_multi-log.user.js文件,它的位置是
C:\Documents and Settings\{windows user name}\Application Data\Mozilla\Firefox\Profiles\{firefox profile name}.default\gm_scripts\google_account_multi-log
注意,{}部分需要替换成你自己的用户名。
replace Line 176
selectBox.innerHTML = '<form name="gmLoginForm" action="https://www.google.com/accounts/ServiceLoginAuth" method="post" style="display:inline;"><select style="font-family:arial,san-serif; font-size:7pt; padding:0px; height:16px;" name="gmSelectLogin"><option>Change User...</option><option disabled="disabled">——</option>' + makeUserList('<option>', '</option>', false) + '<option disabled="disabled">——</option><option>Add Account...</option><option>Remove Account...</option><option>Sign Out</option></select><input type = "hidden" name="continue" value="' + ((document.domain.indexOf("mail.google") != -1)?"https://mail.google.com/mail/?nsr=1":document.location.href.split("#")[0]) + '" /><input type="hidden" name="PersistentCookie" /><input type="hidden" name="Email" /><input type="hidden" name="Passwd" /><input type="hidden" name="service" value="' + getService() + '" /></form>';
with
selectBox.innerHTML = '<form name="gmLoginForm" action="https://www.google.com/accounts/ServiceLoginAuth" method="post" style="display:inline;"><select style="font-family:arial,san-serif; font-size:7pt; padding:0px; height:16px;" name="gmSelectLogin"><option>Change User...</option><option disabled="disabled">——</option>' + makeUserList('<option>', '</option>', false) + '<option disabled="disabled">——</option><option>Add Account...</option><option>Remove Account...</option><option>Sign Out</option></select><input type = "hidden" name="continue" value="' + ((document.domain.indexOf("mail.google") != -1)?"https://mail.google.com/mail/?nsr=1":document.location.href.split("#")[0]) + '" /><input type="hidden" id="gaml_PersistentCookie" name="PersistentCookie" /><input type="hidden" id="gaml_Email" name="Email" /><input type="hidden" id="gaml_Passwd" name="Passwd" /><input type="hidden" name="service" value="' + getService() + '" /></form>';
replace Line 82-84
this.parentNode.Email.value = un;
this.parentNode.Passwd.value = pw;
this.parentNode.PersistentCookie.value = al;
with
document.getElementById('gaml_Email').value = un;
document.getElementById('gaml_Passwd').value = pw;
document.getElementById('gaml_PersistentCookie').value = al;
update:
意外发现以上的修改方法对Gmail无效——Gmail自带多帐户管理功能,所以我几乎不使用这个脚本切换Gmail账号。
修订之后的改法只需在原作者代码上修改一处:
replace Line 82-84
4c80d99067eb03
with
for(i=0; i<this.parentNode.elements.length; i++)
{
if(this.parentNode.elements[i].name=='Email')
this.parentNode.elements[i].value = un;
else if(this.parentNode.elements[i].name=='Passwd')
this.parentNode.elements[i].value = pw;
else if(this.parentNode.elements[i].name=='PersistentCookie')
this.parentNode.elements[i].value = al;
}
Related posts:
- 使用旧版Gmail 如果不是迁移成本太高的话,我可能已经弃用了Gmail。已经不记得从什么时候开始,每次我打开Gmail的瞬间,Flock就会彻底死掉。 一开始的时候我有点茫然,随后我发现纯粹的Firefox还勉强可以顺利的打开Gmail——尽管,速度也是非同一般的慢。考虑到在gtalk上点击新邮件已成习惯,那我只好,把默认的浏览器设成firefox。而事实上,我已经没用firefox很久了。 这两天因为浏览器兼容测试的需要,装了IE7。当我在IE7里打开gmail,搜索过往邮件的时候,它又数度假死。这时我才突然意识到,这一切都肇因于Gmail那悄无声息的升级。我试着在IE7里点击那个”old version”,正是,流畅的gmail又回来了。但是当我进入setting寻找关于使用新版或旧版的设定时,却没有找到这一选项。 无奈,琢磨了一下gmail的链接,几番尝试,确定了这个地址: https://mail.google.com/?ui=1 把它添加到收藏夹,直接使用这个地址访问,即可进入旧版。...
- 链接点出统计补完 在某处用上了chedong提供的基于Google Analytics的点出统计,是通过在链接被触发的时候加上监测outbound,代码如下 document.onclick = function(e) { e = e ||...
- CakePHP 实例教程: Categories Acts as Tree Tree是CakePHP 1.2的核心Behaviors之一,可以用来轻易的实现无限极分类,并呈现树状列表。 图片来源:Tree traversa,WIKIPEDIA 基础实例 建立数据表 CREATE TABLE `categories` (...
{ 1 comment… read it below or add one }
zzzz