Web 2.0 时代,各种互联网公司都想靠 网页浏览器 来圈地、圈钱,争相推出自己的原创/马甲浏览器,功能或简或繁,但总有些 实用功能缺这少那…… 而且即便内核相同,扩展插件的 API 也互不兼容,一个实用插件往往要为有较大用户基数的浏览器维护不同的源码、安装包……
所以,若 标准 HTML/CSS/JavaScript 能解决的问题,我们就可以用 javascript:
这样的通用协议,把 JS 插件封装成一个 收藏栏按钮,每次只需轻轻一点~
如果 Bookmarklet 这样的空间、权限有限的技术很难满足新需求,那本项目的程序源码也可以作为各种版本浏览器插件的蓝本(核心逻辑)来用~
【注】本项目的安装代码均使用 UglifyJS 压缩
发布博文 —— http://log.fyscu.com/index.php/archives/118/
javascript: (function(a,b){function c(a,b){return[].slice.apply(a.getElementsByTagName(b))}function d(a,c){var d=a.currentStyle?a.currentStyle.getAttribute(c):b.defaultView.getComputedStyle(a,null).getPropertyValue(c),e=Number("0px"==d?0:d);return isNaN(e)?d:e}function e(a,b){for(var c=0;c<b.length;c++)if(d(a,b[c][0])==b[c][1])return 1}function f(a,c,d){for(var e=0;d>e;e++)try{if(a.parentNode===c)return 1;if(a.parentNode===b)break;a=a.parentNode}catch(f){console.log(f)}}function g(c){var g=e(c,[["display","none"],["visibility","hidden"],["width",0]]),h=!g&&e(c,[["position","absolute"],["position","fixed"]]);return h&&(a.FLC?!0:d(c,"z-index")>100)?f(c,b.body,a.FLC?13:3):void 0}var k,i,j,h=c(c(b,"body")[0],"*");for(i=0,j=0;i<h.length;i++)k=h[i],g(k)&&(k.parentNode.removeChild(k),console.log(k),j++);self.FLC||(self.FLC=!0),alert([j," of the fucking Float ADs/Layers have been cleaned !~","\n","You can try Clicking my Button again to be cleaner.","\n\n","(C)2014 SCU FYclub-RDD"].join(""))})(self,self.document);
发布博文 —— http://log.fyscu.com/index.php/archives/210/
javascript: (function(BOM){function Random_SN(a){return Math.floor(Math.random()*a.length)}function Probability_Random(a){var b;void 0===a.Random_SN&&(a.Random_SN=-1);do b=Random_SN(a);while(b==a.Random_SN);return a.Random_SN=b,a[b]}function Sequence_Random(a){return a.splice(Random_SN(a),1)[0]}Array.prototype.random=Array.prototype.random||function(a,b){return a?b?Sequence_Random(this):(this.Random_Queue&&this.Random_Queue.length||(this.Random_Queue=[].concat(this)),Sequence_Random(this.Random_Queue)):Probability_Random(this)},String.prototype.trim=String.prototype.trim||function(){return this.replace(/(^\s*)|(\s*$)/g,"")},BOM.getAllFrames=BOM.getAllFrames||function(){var c,d,a=[],b=this.frames;for(c=0,d=0;c<b.length;c++)a[d++]=b[c],b[c].frames.length&&(a=a.concat(arguments.callee.call(b[c])));return a},BOM.eachFrame=BOM.eachFrame||function(){var c,b,a=[this].concat(BOM.getAllFrames.call(this));for(b=0;b<a.length;b++)try{if(c=arguments[0].call(a[b],a[b].document),c===!1)break;if(void 0!==c)return c}catch(d){}},BOM.getSelectedText=BOM.getSelectedText||function(){return BOM.eachFrame.call(this,function(_DOM_){var This_Tag=_DOM_.activeElement;if(_DOM_.selection)return _DOM_.selection.createRange().text;switch(This_Tag.tagName.toLowerCase()){case"input":case"textarea":with(This_Tag)return value.slice(selectionStart,selectionEnd);case"body":default:return _DOM_.getSelection().toString()}})}}(top),function(a,b,c){var d=a.getSelectedText().trim();return d?a.open(["http://",c.random(!0),"/search?newwindow=1&lr=lang_",b,"&q=",a.encodeURIComponent(d)].join(""),"_blank"):(a.confirm(["您未选中任何网页中的文字……","『确定』进入问题反馈;『取消』即退出本工具。"].join("\n\n\n"))?(a.prompt("输入框中的是『运行环境』信息,请直接复制它们,按『确认』即可访问 原作者主页~",navigator.userAgent),a.open("http://www.fyscu.com/","_blank")):a.alert("【Google 中文划词搜索 v1.3】\n\n(C)2013-2016 四川大学·飞扬俱乐部·研发部"),void 0)})(top,"zh-CN",["sssis.com","www.90r.org","booo.so","g.ttlsa.com","lamjoeone.info","g.net.co","iguge.tk","jiong.lu","xie.lu","ggncr.com","everthis.com","ppx.pw","gugesou.com","soso.red","521.pt","google.sqzr.cc","yue.pao.im","da.pao.im","g.xjliao.me","gg.eeload.com","repigu.com","jinke.la","glgoo.com","googleforchina.com","74.125.12.198","209.116.186.219","173.194.121.28","g.hi18.cn"]);
发布博文 —— http://log.fyscu.com/index.php/archives/211/
javascript: (function(BOM){function Random_SN(a){return Math.floor(Math.random()*a.length)}function Probability_Random(a){var b;void 0===a.Random_SN&&(a.Random_SN=-1);do b=Random_SN(a);while(b==a.Random_SN);return a.Random_SN=b,a[b]}function Sequence_Random(a){return a.splice(Random_SN(a),1)[0]}Array.prototype.random=Array.prototype.random||function(a,b){return a?b?Sequence_Random(this):(this.Random_Queue&&this.Random_Queue.length||(this.Random_Queue=[].concat(this)),Sequence_Random(this.Random_Queue)):Probability_Random(this)},String.prototype.trim=String.prototype.trim||function(){return this.replace(/(^\s*)|(\s*$)/g,"")},BOM.getAllFrames=BOM.getAllFrames||function(){var c,d,a=[],b=this.frames;for(c=0,d=0;c<b.length;c++)a[d++]=b[c],b[c].frames.length&&(a=a.concat(arguments.callee.call(b[c])));return a},BOM.eachFrame=BOM.eachFrame||function(){var c,b,a=[this].concat(BOM.getAllFrames.call(this));for(b=0;b<a.length;b++)try{if(c=arguments[0].call(a[b],a[b].document),c===!1)break;if(void 0!==c)return c}catch(d){}},BOM.getSelectedText=BOM.getSelectedText||function(){return BOM.eachFrame.call(this,function(_DOM_){var This_Tag=_DOM_.activeElement;if(_DOM_.selection)return _DOM_.selection.createRange().text;switch(This_Tag.tagName.toLowerCase()){case"input":case"textarea":with(This_Tag)return value.slice(selectionStart,selectionEnd);case"body":default:return _DOM_.getSelection().toString()}})}}(top),function(a,b,c){var d=a.getSelectedText().trim();return d?(a.open(["http://",c.random(!0),"/search?newwindow=1&q=",a.encodeURIComponent([d," site:",b.domain].join(""))].join(""),"_blank"),b.domain.match(/^[^\.]+\.(edu|net|org|com|gov)(\.[^\.]+)?$/)||(b.domain=b.domain.replace(/^[^\.]+\./,"")),void 0):(a.confirm(["您未选中任何网页中的文字……","『确定』进入问题反馈;『取消』即退出本工具。"].join("\n\n\n"))?(a.prompt("输入框中的是『运行环境』信息,请直接复制它们,按『确认』即可访问 原作者主页~",a.navigator.userAgent),a.open("http://www.fyscu.com/","_blank")):a.alert("【Google 站内搜索工具 v1.4】\n\n(C)2013-2016 四川大学·飞扬俱乐部·研发部"),void 0)})(top,top.document,["wen.lu","awk.so","sssis.com","www.90r.org","gu1234.com","booo.so","www.souji8.com","hk.souji8.com","g.ttlsa.com","gvgle.com"]);
发布博文 —— [http://bbs.fyscu.com/forum.php?mod=viewthread&tid=4685
javascript: (function(a){var c,d,b=a.location.href.split("/");if(!b[0].match(/^(http|https|file|ftp):$/))return alert("当前网址所指向的不是有效的网络资源,无法回溯……")||!1;if(c=b.length,""===b[c-1]&&(b.pop(),c--),c>3)b.splice(-1,1);else{if("www."===b[2].slice(0,4))return alert("当前网址已是该网站的顶端,不能再回溯了~");d=b[2].split("."),d.splice(0,1),d.length<3&&d.splice(0,0,"www"),b[2]=d.join(".")}a.location.href=b.join("/")})(top);
发布博文 —— http://my.oschina.net/TechQuery/blog/638707
javascript: (function(a,b){function c(a){return JSON.parse(JSON.stringify(a.ownerDocument.defaultView.getComputedStyle(a)))}function f(a){var f,b=e.contentWindow.document;return d[a]||(f=b.createElement(a),b.body.appendChild(f),d[a]=c(f),b.body.removeChild(f)),d[a]}function g(){var e,a={},b=c(arguments[0]),d=f(arguments[0].tagName.toLowerCase());for(e in b)!isNaN(Number(e))||e.match(/^(moz|webkit|ms)/)||b[e]==d[e]||e.match(/width|height/i)||(a[e]=b[e]);return a}var d={},e=b.createElement("iframe");e.style.display="none",b.body.appendChild(e),a.CSS_Inline=function(){var b,a=g(arguments[0]);for(b in a)arguments[0].style[b]=a[b]},a.Image_Inline=function(a,c){var f,d=new Image,e=b.createElement("canvas");d.crossOrigin="",f=e.getContext("2d"),d.onload=function(){e.width=d.width,e.height=d.height,f.drawImage(d,0,0),c&&(f.font="20px sans-serif",f.fillStyle="white",f.fillText(c,10,d.height-15)),a.src=e.toDataURL("image/png"),d=null},d.src=a.src},a.Web_Inline=function(){var b,a=arguments[0].querySelectorAll("*");for(b=0;b<a.length;b++)switch(a[b].tagName.toLowerCase()){case"meta":case"style":case"script":case"iframe":a[b].parentNode.removeChild(a[b]);break;case"img":this.Image_Inline(a[b],arguments[1]);break;default:this.CSS_Inline(a[b])}return arguments[0].innerHTML.trim()},a.Web_Inline(b.body,a.prompt("图片水印文字:")),a.setTimeout(function(){b.body.textContent=b.body.innerHTML,a.alert("请全选、复制当前显示的所以代码~")},1e3)})(self,self.document);
发布博文 —— http://my.oschina.net/TechQuery/blog/350954
<textarea />
、<iframe />
、<div />
等可编辑容器)javascript: (function(a){var b=!!a.document.attachEvent,c={text:"text/plain",url:"text/unicode",html:"text/html"},d=b?["attachEvent","onpaste","detachEvent"]:["addEventListener","paste","removeEventListener"];a.getPaste=a.getPaste||function(a,e){var f=this;a=b?a:c[a.toLowerCase()],f.document[d[a?0:2]](d[1],function(){var c=arguments[0]||f;!1===e.call(c.target||c.event.srcElement,c.clipboardData.getData(a))&&(b?c.event.returnValue=!1:c.preventDefault())},!1)},a.getAllFrames=a.getAllFrames||function(){var c,d,a=[],b=this.frames;for(c=0,d=0;c<b.length;c++)a[d++]=b[c],b[c].frames.length&&(a=a.concat(arguments.callee.call(b[c])));return a},a.eachFrame=a.eachFrame||function(){var d,c,b=[this].concat(a.getAllFrames.call(this));for(c=0;c<b.length;c++)try{if(d=arguments[0].call(b[c],b[c].document),d===!1)break;if(void 0!==d)return d}catch(e){}},a.HTML_Inject=a.HTML_Inject||function(b){var c=a.eachFrame(function(a){var b=a.activeElement;if(!b)return!1;switch(b.tagName.toLowerCase()){case"body":case"input":case"select":return;case"iframe":if(b.contentWindow.frames.length)return;b=b.contentWindow.document.body}return b});return c?(c.innerHTML=b||a.prompt("请输入要插入的 HTML 代码片段"),c.innerHTML||(c.iWatch||(a.getPaste.call(c.ownerDocument.defaultView,"Text",function(a){return c.innerHTML=a,!1}),c.iWatch=!0),a.alert("本次没有输入,但之后您可以直接在目标编辑框中粘贴(无需再次点击本工具)~")),void 0):a.alert("未找到可用的插入点……\n\n请在要插入代码的编辑框中单击鼠标,再点击本工具~")},a.HTML_Inject()})(self);
发布博文 —— http://log.fyscu.com/index.php/archives/125/
javascript: (function(a,b,c){function f(a){return a.match(/^\w+:\/\//)&&(a=a.split("/").slice(3),a.unshift("."),a=a.join("/")),a}function g(a){var b,d;for(a=a.split(","),b=[],d=0;d<a.length;d++)c(a[d].trim().split(":")[0]).length||b.push(a[d]);return b}function h(a){var b,e,f,i,h;try{b=a.cssRules||a.rules}catch(c){}if(e=[],f={media:a.media.mediaText,mediaRules:[],fontsRules:[]},b){for(h=0;h<b.length;h++)switch(i=b[h],i.type){case 1:i=g(i.selectorText),i.length&&e.push(i);break;case 4:f.mediaRules.push(arguments.callee(i)[0]);break;case 5:f.fontsRules.push({fontFamily:i.style.fontFamily,src:i.style.src})}f.WasteRate=(100*(e.length/h)).toFixed(2)+"%"}return[f,e]}var j,i,k,d=b.styleSheets,e="(C)2014-2015 test_32@fyscu.com";if(!c)return a.alert("Please run This Tool in IE 8+ (Standard Mode) or a Modern Web Browser.\n\n"+e),!1;if(!console)return a.alert("Please run This Tool with JavaScript Console opened.\n\n"+e),!1;for(i=0,k=[];i<d.length;i++)k[i]=h(d[i]),j=k[i].shift(),j.href=d[i].href,j.WasteRate&&j.href&&(j.href=f(j.href)),j.element=d[i].ownerNode,console.log(j);console.log(k)})(self,self.document,self.document.querySelectorAll);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型