(2009-7-3修改代码)
今天和大家分享一个小技巧,如何移除gmail右侧的广告?
如果你使用客户端处理gmail邮件的话,那不用看接下来的内容了,用客户端没有广告。
我说的广告,是指下图中的红框部分,因为本来笔记本的分辨率就小(1024),再加上我把标签栏移到了右边,要是还有广告的话,正文会显得十分拥挤:
移除这个广告的方法,主要是用user css,或者是user js
新建一个gmail-removeAD.css的文件,用文本编辑器便器,使内容是:
/*加大正文字体及行高*/
.ii.gt,.ii.gt *{font-size:14px !important;line-height:1.5 !important}
/*隐藏读信广告*/
table.T1HY1.nH.iY{width:100% !important;}
table.Bs.nH.iY td.Bu:last-child{display:none;}
/*下面是把快速动作栏隐藏起来了,如果你需要的话,去除从position到important的注释,并且删除display:none这一句*/
table.T1HY1.nH.iY td.tELAdc:last-child{/*position:absolute !important;top:-65px !important;left:0 !important;*/display:none}
table.T1HY1.nH.iY td.tELAdc:last-child .nH{width:auto !important}
table.T1HY1.nH.iY td.tELAdc:last-child .hk{float:left !important;margin-left:1em !important;}
/*这一句是隐藏邀请朋友框*/
.nH.pp.ps .pY{display: none !important;}
然后在浏览器中对gmail使用这个样式表就行了,下面是使用之后的截图,是不是清爽了很多?
// ==UserScript==
// @name GMail – Remove ads and relocate action links
// @namespace http://userstyles.org
// @description This style removes the ad panel from Gmail or Google Apps Mail, relocates the action links (Print all, new window, etc.) from the side bar to above the mail subject, and widens the mail content area
// @author lOtR
// @homepage http://userstyles.org/styles/11768
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// @include http://*.mail.google.com/*
// @include https://*.mail.google.com/*
// ==/UserScript==
(function() {
var css = “.ii.gt,.ii.gt *{font-size:14px !important;line-height:1.5 !important;}table.T1HY1.nH.iY{width:100% !important;}table.Bs.nH.iY td.Bu:last-child{display:none;}table.T1HY1.nH.iY td.tELAdc:last-child .nH{width:auto !important}table.T1HY1.nH.iY td.tELAdc:last-child .hk{float:left !important;margin-left:1em !important;}.nH.pp.ps .pY{display: none !important;}”;
if (typeof GM_addStyle != “undefined”) {
GM_addStyle(css);
} else if (typeof addStyle != “undefined”) {
addStyle(css);
} else {
var heads = document.getElementsByTagName(“head”);
if (heads.length > 0) {
var node = document.createElement(“style”);
node.type = “text/css”;
node.appendChild(document.createTextNode(css));
heads[0].appendChild(node);
}
}
})();
将这个脚本放入目录 C:Documents and Settings{username}Local SettingsApplication DataGoogle(Chromium)ChromeUser DataDefaultUser Scripts 下。
修改chrome快捷方式的属性,使其能使用userjs,比如这样的”C:Documents and Settings{username}Local SettingsApplication DataGoogleChromeApplicationchrome.exe” –enable-user-scripts。
另外,Google不好的一点是,在搜索的结果里面,会加入一个重定向的功能,也就是如果你登陆了gmail,在你点击搜索结果的时候,为了能记录你的浏览历史,google会把网址变为http://www.google.com/url?sa=U&start=1&q=……这样的形式,有时候你访问被墙的东西时,整个google就会被封掉……。解决办法是用一个user js,内容很简单
// ==UserScript==
// @include http://www.google.com/search?*
//
// ==/UserScript==var linkList = document.getElementById(“res”).getElementsByTagName(“a”);
for(var i = 0; i < linkList.length; i++) {
var link = linkList[i];
link.setAttribute(‘onmousedown’,null);
}
这篇日志参考了http://ytzong.blogspot.com/2009/03/stylishgmail.html和http://zhiqiang.org/blog/posts/enable-userscripts-chrome-gmail.html
其实最省事情的提高工作效率办法
就是安一个ff addon 叫做zemanta,,,刚好把广告给盖住了,,
不过倒是错失一次动手的机会:)
过来支持一下,O(∩_∩)O~
哇~谢谢
我修改了一下你的脚本,希望没有问题
Hi,
Ugh, I liked! So clear and positively.
Thanks
CustomizeGoogle 还是好使的
个人比较喜欢用它是因为它可以对google的很多产品页面进行设置, 再比如搜索页面右侧的广告、设置默认使用安全连接等, 不过这也都跟个人喜好和习惯相关了 ;b
嗯,我看到有意思的广告总会去点…
Gmail广告同邮件内容的管理性太强了…
如果用Firefox的话,用一些扩展也是很好的方式,比如 CustomizeGoogle
我在搜索解决方案的时候看到好像customizeGoogle不好使了,另外我很少用Firefox,呵呵