Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ajax In Action (2006).pdf
Скачиваний:
63
Добавлен:
17.08.2013
Размер:
8.36 Mб
Скачать

Installing Firefox extensions

585

 

 

Figure A.13 The IEDocMon toolbar for Internet Explorer provides functionality similar to the Firefox DOM Inspector, allowing for rapid resolution of rendering issues with programmatically generated user interfaces.

A.4.3 The Safari DOM Inspector for Mac OS X

The Mac OS X browser Safari has a built-in DOM inspector too. This is available from the debug menu. The debug menu is not enabled by default. To enable it, open the Terminal application and type in the following:

defaults write com.apple.Safari IncludeDebugMenu 1

Depending on your privileges, you may need to sudo this command. Once it has executed, restart Safari and the debug menu should appear.

A.5 Installing Firefox extensions

We’ve already looked at two very useful Firefox extensions, the Venkman debugger and the LiveHTTPHeaders network debugger. There are many extensions available for Firefox, and several are designed for use by web developers. In this

586APPENDIX A

The Ajax craftsperson’s toolkit

Figure A.14 The Firefox browser lists all installed extensions in a pop-up dialog. More extensions can be installed from the Web.

section, we’ll walk briefly through the process of installing a Firefox plug-in, using the Modify Headers extension as an example.

Firefox extensions are installed from the web browser itself. Initially, you need to locate the download page for the extension; in this case it’s found at https:// addons.mozilla.org/extensions. The Mozilla add-ons site can also be launched from the browser by clicking the Tools > Extensions menu and then selecting the Get More Extensions link in the pop-up dialog. Figure A.14 shows Firefox pointing at the Mozilla Update site page for the Modify Headers extension.

In this case, the hyperlink we need is the large Install Now button. We click on it, and a dialog appears, warning us of the dangers of installing unsigned extensions (figure A.15).

Unlike ordinary JavaScript code, extensions have full access to the local filesystem. Signing extensions offers a guarantee from the author that the extension hasn’t been tampered with, but in practice, not all extensions are signed. After installation, the extension is registered in the pop-up Extensions dialog (figure A.16).

Installing Firefox extensions

587

 

 

Figure A.15

Firefox extensions can be installed from the Web, using a special downloadable archive format.

All that remains is to close down all open Firefox windows (including DOM inspectors, debuggers, and so on), and restart Firefox. The extension is then ready to run, appearing as an option in the Tools menu (figure A.17).

Firefox supports a large number of extensions, many of which are aimed at web developers. Not all extensions are hosted on the addons.mozilla.org site, but this is certainly the first port of call for such things. The installation procedure is generally similar for all extensions, including the Venkman debugger that we discussed earlier.

This concludes our review of development tools for Ajax. We hope that it has provided you with some useful advice in getting your project off the ground.

Figure A.16

Newly installed extensions are visible in the Extensions dialog immediately but won’t become active until the browser is restarted.

588APPENDIX A

The Ajax craftsperson’s toolkit

Figure A.17

After you restart the browser, the extension is ready to use.

A.6 Resources

This chapter was all about tools. Here are links to those that we featured:

Textpad: www.textpad.com

jEdit: www.jedit.org

Eclipse: www.eclipse.org

Eclipse JavaScript plug-ins: http://jseditor.sourceforge.net/

Visual Studio Express: http://lab.msdn.microsoft.com/express/

Dreamweaver: www.macromedia.com/software/dreamweaver/

Komodo: www.activestate.com/Products/Komodo/

Venkman Debugger: www.mozilla.org/projects/venkman/

Microsoft Script debugger: www.microsoft.com/downloads/details.aspx? FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&displaylang=en

Charles: www.xk72.com/charles/

Fiddler: www.fiddlertool.com

LiveHttpHeaders: http://livehttpheaders.mozdev.org/

Modify Headers extension: https://addons.mozilla.org/extensions/moreinfo.php?id=967&vid=4243

IEDocMon DOM inspector for IE: www.cheztabor.com/IEDocMon/index.htm