返回正常中文阅读

想对这篇译文“指手画脚”吗?

您的参与将有助于译者提高译文的质量;同时,大家一起对问题的讨论也是最佳的学习方式。还等什么?请现在就注册登录译言,开始眉批!
大错 小错 不顺 建议

Collection of Web Developer Tools for major browsers

With so many browser out there in the wild, working as a Web Developer certainly is not an easy job these days. Thankfully, over the last years, decent tools have been developed by bright people that make developing and debugging of code easier for the developer. But sometimes, it is not easy to keep track which tools are at a Developer’s disposal (and which are actually usable). The following article seeks to list the best tools available and quickly describing how to activate/install/use them.

To give a quick overview of the tools per browser, please refer to the table below.

Browser Available Tools (main area of debugging in parenthesis)
Firefox
IE6, IE7
Opera
Safari

Web Developer Toolbar

If you can only pick one extension to install for debugging and developing web sites in Firefox, it has to be the Web Developer Toolbar. A real gift for web developers, cause it consists of a myriad of tools ranging from Cookie related tasks (disable, delete, view their content) to CSS, display of line guides, ruler and much too many to mention. Go and install it now.

Firebug

If you are using Firefox, Firebug is probably the first or second extension you should install (in addition to Web Developer Toolbar). Firebug lets you inspect, monitor and edit HTML, CSS and JavaScript live on any web page. In addition to that, it provides a script console which makes JavaScript development much easier. The console object offers a huge load of options that lets you output code to the console and debug it. Michael Sync provides a tutorial that explains these options in further detail. Also included in Firebug is a bandwidth monitor to track which resources on your site consume how much bandwidth. A must.

Modify Headers

Modify Headers is a useful extension to add, modify and filter out HTTP request headers. As stated on the web site, you could fake a request from a mobile device or an Ajax request.

Poster

The Poster extension is a developer tool for interacting with web services and other web resources that lets you make HTTP requests, set the entity body, and content type. This allows you to interact with web services and inspect the results.

XRAY & MRI

XRAY and MRI are bookmarklets for Internet Explorer 6+, and Webkit and Mozilla based browsers (including Safari, Firefox, Camino or Mozilla). XRAY can be used to inspect the box model for any element on the page, whereas with MRI you can test and play with selectors.

Firefox Accessibility Extension

The Mozilla/Firefox Accessibility Extension makes it easier for people with disabilities to view and navigate web content. Developers can use the extension to check their use of structural and styling markup that support functional web accessibility.

IE Developer Toolbar

Microsofts Internet Explorer Developer Toolbar is, when it comes to DOM inspection and CSS debugging, the best tool out there for IE debugging. Due to the high market share and flaws in the whole rendering model (like hasLayout), debugging IE can’t be ignored but can become a nightmare pretty quickly without the toolbar. It still is a bit clunky and far less slick than Firebug, but it helps to tame the IE beast.

Web Accessibility Toolbar

The Web Accessibility Toolbar (version for Opera) offers functionality that not only lets you check how accessible your site is (or rather might be, cause machines can’t really check how accessible something is for humans), but also provide a bunch of other features like e.g. validation links or resizing of the browser window.

Visual Web Developer Express Edition

As JavaScript debugging is not included in the IE Developer Toolbar, you need a different tool to do that. You can either use the Microsoft Script Debugger (mentioned below) or download (for free) the much heavier Visual Web Developer Express Edition. Bernie explains how to use it to debug errors in your JavaScript code on your web site.

You can also use Microsoft Script Editor, which is, unfortunately, not really free, but rather included in the Microsoft Office 2003 bundle and not available as a separate download. Because of that, I am not including it in this list, but Jonathan Boutelle offers some instructions how to use it for debugging.

Microsoft Script Debugger

You can download this MS debugger from their download section for free and there is even a documentation on MSDN. It provides less functionality than the Visual Web Developer Express Edition, but still helps you to deal with more or less cryptic error messages like “object required” that IE normally comes up with. Jake Howlett describes how to debug JavaScript using Microsoft Script Debugger at codestore. As a sidenote and to be safe, after installing the Script Debugger, restart your machine to be able to use it next time you start IE.

Opera developer tools

On their developer site, Opera mentions two developer tools, Opera Developer Console and DOM Snapshot, as some kind of bookmarklets for their browser version 9 and above. From the screenshots presented, they both look very promising. Unfortunately, I could not get them to work in version 9.10.

Opera Error Console

The error console is a built-in feature of the Opera browser and can be activated going to Tools > Advanced > Error console. A window pops up which displays any kind of error or warning messages related to the currently loaded web page. They can also be filtered by certain categories (e.g. HTML, CSS, XML, JavaScript). You can find a detailed article about using the Error Console as a debugging tool in the developer section of the Opera Web site.

Safari Debug Menu

Safari’s debug capabilities are kind of poor, but at least there is a way to display a JavaScript console (similar to Firebug and Opera Error Console) to make JavaScript debugging a bit easier. In the developer section of the Apple Web site, there is a FAQ article that explains how to enable the hidden debug menu. On Mac OSX, open a terminal and type:

defaults write com.apple.Safari IncludeDebugMenu 1

On Windows, use a text editor to add the following to the Preferences.plist file located at C:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Documents and Settings\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\USERNAME\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Application Data\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Apple Computer\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Safari\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Preferences.plist:

<key>IncludeDebugMenu</key>
<true/>

In Safari 1.3 and above, you can now access the new Debug Menu and check the “Log JavaScript Exceptions” menu item. Then selecting “Show JavaScript Console” will open the console to log JavaScript exceptions.

Web Inspector

To activate the Safari Web Inspector (available in Safari 3 and above) on Mac OS, type the following in a terminal window:

defaults write com.apple.Safari WebKitDeveloperExtras -bool true

On Windows, open WebKitPreferences.plist in Documents and Settings\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*Your User Name*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Application Data\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Apple Computer\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Safari and add this key:

<key>WebKitDeveloperExtras</key>
<true/>

If you then quit your Safari and restart it, you should have an “Inspect Element” option in the context menu.

Web开发工具大集合——每个浏览器都有份的!

网站开发者的一大苦恼,就是有太多的浏览器要应付。幸亏世界上有一些聪明的人,能够研究出一大些方便编辑和调试网页代码的好工具。不过,要从不计其数的小工具里面找出合适的可真不容易。这篇文章列出了几个最好用的web开发工具,并指导你快速地激活、安装、使用他们。

下面是工具列表(译言的编辑器怎么不让用锚点链接?索性全用自己的了,抱歉皱眉):

浏览器 可用的工具 (括号中是应用范围)
Firefox
IE6, IE7
Opera
Safari

Web Developer Toolbar

Firefox上开发和调试web站点的不二之选。Web developer toolbar包含了一系列工具,从cookie管理到CSS调试,从导航线到屏幕标尺,功能简直是多得说不完。
Web开发工具栏 下载地址:http://chrispederick.com/work/web-developer/

Firebug

萤火虫 是Firefox上数一数二的好扩展,可作为web developer toolbar的补充工具。你可以用Firebug在线检查、监控、编辑网页上的HTML、CSS、JavaScript代码。他还提供一个脚本控制台,让JS编辑编的更简单。控制台对象包含了一大堆选项,允许你输出代码到控制台然后进行调试。Michael Sync提供一个更高级的操作指南,它可以知道你详尽地设置Firebug的选项。另外,Firebug上有一个带宽监视器,能让你清楚地看到某些代码占了多少带宽。
Firebug 下载地址:http://www.getfirebug.com/

Modify Headers

Modify headers是一个可以添加、修改和过滤HTTP请求头的工具。你可以用这个工具冒充成移动设备登陆网站,它甚至可以伪造一个Ajax请求。
Modify Headers 下载地址:http://modifyheaders.mozdev.org/


Poster

你可以通过Poster扩展与Web服务或者其他web资源进行交互,它能让你发送HTTP请求、设置请求实体和内容格式。这可以让你检测Web交互的效果。
Poster下载地址:http://code.google.com/p/poster-extension/

XRAY & MRI

X光核磁共振成像是可以应用在IE6+、Webkit和Mozilla为基础的浏览器上的bookmarklets(嘛叫Bookmarklets),包括Safari, Firefox, Camino和Mozilla. Xray 能帮你检测盒模型里的每一个元素,MRI可以测试和应用选择器。
XRay下载地址:http://www.westciv.com/xray/index.html
MRI下载地址:http://www.westciv.com/mri/

Firefox Accessibility Extension

Mozilla/Firefox无障碍扩展让残疾人士方便地浏览网页内容。开发人员可以用这个扩展检查他们的结构和样式的网页易读性。
Firefox Accessibility Extension下载地址:http://firefox.cita.uiuc.edu/


IE Developer Toolbar

微软的英特网探索者开发工具条是IE上最好的DOM检查和CSS调试工具。由于IE具有高市场占有率而又在整个渲染模型上充满缺陷(比如臭名昭著的hasLayout边距重叠BUG),调试IE是web开发必不可少的步骤——没有这个工具条,IE的调试将会成为一场噩梦。虽然IE Developer Toolbar要比Firebug稍微弱智一点,不过他至少能帮你驯服IE这头怪兽。
IE Developer Toolbar下载地址:http://www.microsoft.com/downlo...aylang=en


Web Accessibility Toolbar

The Web Accessibility ToolbarOpera版)可以检查网站的易读性(当然是可能的易读性,总不能指望电脑能像人一样读网页吧?)此外,这个工具还提供其他功能,比如检查死链接和改变浏览框大小等等。
The Web Accessibility Toolbar下载地址:http://www.visionaustralia.org.au/ais/toolbar/


Visual Web Developer Express Edition

IE开发工具栏木有JavaScript调试功能,你得找个别的工具搞JS。你可以用Microsoft Script Debugger(下面将提到)或者免费下载这个重量级的Visual Web Developer Express Edition。Bernie那儿有这个工具的教程(当然是英文的),它详尽地告诉你如何用这个工具调试JavaScript代码。

你也可以用Microsoft Script Editor 编辑 JS代码——不幸的是,这并不是个免费工具(在国内,这似乎不是个大问题)。他被捆绑在Office 2003安装包里,而微软又不提供单独下载。正因为如此,这儿就不多提它了。Jonathan Boutelle提供了这个工具的一些教程

Microsoft Script Debugger

你可以在微软网站上免费下载这个工具MSDN上也有一个相关文档。这个工具比Visual Web Developer Express Edition弱很多,不过仍然能处理一些IE上那些让人摸不着头脑的提示,诸如“缺乏对象”一类。Jake Howlett 有个《如何使用Microsoft Script Debugger调试JavaScript》的教程。为安全起见,安装脚本调试器之后最好要重新启动一下你的电脑。
Microsoft Script Debugger下载地址:http://www.microsoft.com/do..laylang=en

Opera developer tools

Opera有两个开发工具:Opera 开发控制台(Opera Developer Console)和Dom快照工具(DOM Snapshot)。从截图来看,他们都很有前途。这个工具算是Opera 9以上版本用的bookmarklets。不过我没能让他们在Opera 9.10上成功运作。
Opera开发工具下载地址:http://dev.opera.com/tools/

Opera Error Console

错误控制台是Opera的一个内置功能,可以在工具-高级-错误控制台中激活这个它。它能弹窗显示当前网页上的错误或者警告信息,或者你可以过滤某种类型的信息,比如HTML、CSS、XML或者Javascript警告。你可以在opera网站找到错误控制台的详细教程

Safari Debug Menu

Safari的debug能力很弱,但至少显示一个Javascript控制台能让Javascript调试变得简单点儿(这与Firebug和Opera错误控制台类似)。在苹果网站的开发部门,有一个常见问题文档说明如何启用隐藏的调试菜单。
在Mac OS X下,打开一个终端然后输入:

defaults write com.apple.Safari IncludeDebugMenu 1

在windows 下,用文本编辑器打开Preferences.plist,这个文件的位置往往是C:\Documents and Settings\USERNAME\Application Data\Apple Computer\Safari\Preferences.plist,在文件最后添加:

<key>IncludeDebugMenu</key>
<true/>

Safari 1.3及以上版本,你可以进入Debug菜单然后钩选“记录Javascript意外”的选项。然后选择“显示JavaScript Console”。这就可以用控制台记录Javascript错误。

Web Inspector

要在Mac OS上激活Safari Web Inspector (Safari 3及以上可用),打开终端窗口然后输入

defaults write com.apple.Safari WebKitDeveloperExtras -bool true

在windows中,打开Documents and Settings\*你的用户名*\Application Data\Apple Computer\Safari\WebKitPreferences.plist,添加以下内容:

<key>WebKitDeveloperExtras</key>
<true/>

然后退出Safari并重新打开,你将在菜单中看到一个“检查元素”选项,就是它了!

作者:Klaus Komenda , 翻译:butwho
英文原文:Collection of Web Developer Tools, per Browser
原文发现:译言-Collection of Web Developer Tools for major browsers
中文译文:http://www.butwho.net/2008/05/collection-of-web-developer-tools-per-browser.html

首次翻译,效果未必好,有些名词也太专业,请有兴趣的老师同学们认真给俺批评指正!


欢迎访问译言网。在这里,您可以。。。

阅读
发现
翻译