很多青睐HTML5的iOS开发者都从移动版Safari上的Firebug中受益匪浅,一般情况下你可以使用简化版Firebug Lite。但在iPad和iPhone上添加Firebug书签小工具并不容易。于是Martin Kool分享了这段代码,让你在iPad/iPhone更加方便地使用Firebug。
- 用iPad或iPhone打开本文页面,添加为书签。
- 把书签重命名为“Firebug”。此时该URL无法编辑。
- 点击这个区域:javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,’script’):F[i](‘script’);E[r](‘id’,b);E[r](‘src’,I+g+T);E[r](b,u);(F[e](‘head’)[0]||F[e](‘body’)[0]).appendChild(E);E=new%20Image;E[r](‘src’,I+L);})(document,’createElement’,'setAttribute’,'getElementsByTagName’,'FirebugLite’,’4′,’firebug-lite.js’,'releases/lite/latest/skin/xp/sprite.png’,'https://getfirebug.com/’,'#startOpened’);
- 再次点击,选择“选择全部”,然后点击“复制”
- 编辑Firebug小工具,去掉URL然后选择“粘贴”
- 选择“完成”,搞定。