世界之窗论坛's Archiver

joshyupeng 发表于 2007-12-15 19:46

几个比较有用的脚本书签

源自:[url=https://www.squarefree.com/bookmarklets/webdevel.html]https://www.squarefree.com/bookmarklets/webdevel.html[/url]
只需把它们拖到书签工具栏上即可。

[font=Tahoma][size=2][color=#006400]ancestors[/color][/size][/font]   在状态栏左下角显示鼠标悬停所在页面元素的祖辈元素列表
[size=2]javascript: (function(){function A(n,g){var p=n.parentNode,t=n.tagName;if(!p)return "";if(!t)return A(p,g);var T=t.toUpperCase(),b=(T!="TABLE"&&T!="TBODY"&&T!="THEAD"&&T!="TR"),c=n.className,i=n.id;return A(p,' > ')+(b?T:T.toLowerCase())+(c?"."+c:"")+(i?"#"+i:"")+(b?g:' ');}document.onmouseover=function(e){e=e?e:event;var s,g=e.target;g=g?g:e.srcElement;try{s=A(g,'');}catch(err){s=err.message;}window.status=s;return true;};window.status=A(document.documentElement,'');})()[/size]
[size=2][/size]
[size=2][/size]
[font=Tahoma][size=2][color=#006400]zap style sheets[/color][/size][/font] 取消所有页面css效果
[size=2]javascript: (function(){var i,x;for(i=0;x=document.styleSheets;++i)x.disabled=true;})();[/size]


[color=#800080]generated source[/color] 生成当前页面代码 (很多元素是动态添加的)
[size=2]javascript: (function(){ function htmlEscape(s){s=s.replace(/&/g,'&');s=s.replace(/>/g,'>');s=s.replace(/</g,'<');return s;} x=window.open(); x.document.write('<pre>' + htmlEscape('<html>\n' + document.documentElement.innerHTML + '\n</html>')); x.document.close(); })();[/size]
[size=2][/size]
[font=Tahoma][size=2][color=#006400]onerror alert[/color][/size][/font] 当页面脚本有错误了,弹出对话框警告
javascript:window.onerror = function(m,u,n) { alert("JS error: " + m + (/^javascript:/(u) ? "\n\n(bookmarklet)" : "\n\nLine " + n + " of \n" + u)); return true;/*suppress default error message*/ }; void 0

[[i] 本帖最后由 joshyupeng 于 2007-12-15 19:59 编辑 [/i]]

knock3 发表于 2007-12-16 10:29

不错
挺实用的~

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.