Total Pageviews

Friday 24 August 2012

把javascript语句作为书签的内容

通过现在比较流行的bookmarklet,可以使大部分浏览器增加很多的功能。
chrome真的不能过滤广告吗?将以下的javascript语句作为书签的内容(就是原来放网址的地方),书签的名字随便起。然后将这个书签放在书签栏上。遇到广告,点一下就可以过滤了。
javascript:(function(){function R(w){try{var d=w.document,j,i,t,T,N,b,r=1,C;for(j=0;t=["object","embed","applet","iframe"][j];++j){T=d.getElementsByTagName(t);for(i=T.length-1;(i+1)&&(N=T[i]);–i)if(j!=3||!R((C=N.contentWindow)?C:N.contentDocument.defaultView)){b=d.createElement(“div”);b.style.width=N.width; b.style.height=N.height;b.innerHTML=”“+(j==3?”third-party “+t:t)+”“;N.parentNode.replaceChild(b,N);}}}catch(E){r=0}return r}R(self);var i,x;for(i=0;x=frames[i];++i)R(x)})()
类似的功能还有很多,比如,收藏到google网络书签;将网页推荐到豆瓣,推荐到bloger,推荐到facebook,推荐到twitter;用gmail发送当前网页的链接;翻译当前网页;搜索verycd;下载youtube视频;分割浏览器…..
这些都是通过赋予书签内容不同的javascript语句实现的。
你要做的就是,找一个优秀核心的浏览器,然后将这些bookmarklet放在你的书签栏上即可。
有兴趣的话,可以自行搜索“bookmarklet”


搜索了一下, 这是排在前面几位的英文站:
http://www.bookmarklets.com/
https://www.squarefree.com/bookmarklets/
跨平台,跨浏览器,不错!