26.11.2012 Views

Wirtschaftsuniversität Wien Magisterarbeit - SemanticLab

Wirtschaftsuniversität Wien Magisterarbeit - SemanticLab

Wirtschaftsuniversität Wien Magisterarbeit - SemanticLab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.1.6. Accessing SQLite databases<br />

Although the developed extension does not use SQLite databases, the topic should be<br />

briefly discussed for the sake of completeness. SQLite databases have been introduced<br />

with Firefox 3.0. They are easy to handle and can be queried using SQL. By using the<br />

mozStorage API one can directly open a connection to the database and query it by<br />

using JavaScript. The results can then be used to create XUL elements or simply by<br />

building content via JavaScript. [MDC09j] provides an example and more details.<br />

6.1.7. Accessing the local filesystem<br />

Once installed, an extension runs in the scope of the Firefox browser and has therefore<br />

much higher rights on the user’s computer than for example websites which are visited<br />

by using the browser. That means that extensions can access (and therefore also delete)<br />

all files and directories, even recursively! [MDC09k] provides a good overview about the<br />

API and how to use it, including some working examples.<br />

6.1.8. Using a integrated development environment (IDE)<br />

The author strongly recommends using an IDE such as Eclipse to develop Firefox extensions.<br />

It makes the development process a lot easier, for example by using Subversion<br />

(for version management) and Ant to automatically build the xpi-files. There are tools<br />

such as XulBooster (an Eclipse Plugin) 1 , the “Extension Developer’s Extension” (a Firefox<br />

Extension) 2 or the “Firebird/Thunderbird Extension Wizard” 3 available which also<br />

help in setting up a proper environment.<br />

6.1.9. Debugging Firefox<br />

For debugging Firefox extensions, one needs a JavaScript debugger such as Venkman 4<br />

which is Mozilla’s official JavaScript debugger. Although it provides useful insights,<br />

it sometimes cannot help developers, for example, finding out why extensions are not<br />

installed properly or why components are not loaded. This is due to the fact that<br />

Venkman itself comes as an extension and therefore is loaded the same time as other<br />

extensions are loaded and therefore cannot interrupt start-up processes. To accomplish<br />

this, developers have to run Firefox in debug-mode and set breakpoints in the Firefox<br />

source-code itself. More information on that issue can be found at the MDC. Another<br />

very important tool for debugging Firefox is a DOM Inspector. A DOM Inspector such<br />

as “DOMi”, Mozilla’s DOM Inspector 5 , lets you inspect the document structure of XUL<br />

windows and the browser. It is for example very useful to find out how to address XUL<br />

elements if the documentation is not clear in that point.<br />

1 http://cms.xulbooster.org<br />

2 http://ted.mielczarek.org/code/mozilla/extensiondev/<br />

3 http://ted.mielczarek.org/code/mozilla/extensionwiz/<br />

4 https://developer.mozilla.org/en/Venkman<br />

5 https://developer.mozilla.org/en/DOM Inspector<br />

57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!