In association with heise online

28 June 2010, 09:55

New APIs for Mozilla's JetPack: tabs, selection and Ajax

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

Mozilla Jetpack Logo Only about a month after releasing JetPack 0.4, Mozilla has issued the next version of its new plug-in technology framework. Its new features include, for example, interfaces for accessing browser tabs and current text selections and support for automatically translating character strings.

One of the core components of version 0.5 is the Request API, which encapsulates XMLHttpRequest. It returns an XML document or a JavaScript object to the function that is registered with the onComplete property, provided the parser recognises correct responses for this format. Unlike classic Ajax functions, these request objects are not bound by the "same origin" rule which means they can be used with arbitrary URLs.

The Tabs API allows developers to open, close and move browser tabs as well as respond to such events as onOpen, onReady and onActivate. Properties provide access to information such as the title, the favicon and a preview of the page displayed in the tab. The selection module offers methods for getting and setting current selections, as well as an onSelect property; JetPack invokes the callbacks stored in this property when a user has completed a selection.

The Localization API is to provide plug-in developers with an easy way of displaying their extensions in a user's selected language. However, very few details on using it have been documented. The JetPack source code reveals that the translated strings are to be provided by a server at which receives the current locale and plug-in ID as parameters in a XMLHttpRequest. Once they are downloaded, the framework stores the translations locally.

More details about JetPack 0.5 can be found in the release notes. JetPack is available to download (direct download) from the project's FTP server. Developers need Python 2.5 and a current version of the Firefox browser to make use of the SDK.


Print Version | Send by email | Permalink:

  • July's Community Calendar

The H Open

The H Security

The H Developer

The H Internet Toolkit