Developers › Dev.Opera

Getting started with Opera extensions

October 21, 2010 · by Andreas Bovens

Introduction

Our Opera 11 Labs release comes with a standards-based framework for running extensions that add extra functionality to the browser. The extensions framework is built on existing standards, with W3C Widgets and JavaScript as the basis. This means that if you can write a web application or widget you already have the skills you need to write extensions. They also make use of HTML5 technology such as cross-document messaging.

For this release, we've prepared quite a bit of reference documentation and tutorials, and there is more on the way. One caveat though: this is an early release of our extensions implementation, and nothing is really stable. This means that you can expect serious changes in the weeks and months to come — adjustments to existing APIs as well as additional functionality. Of course, we'll do our best to keep the documentation as up-to-date as possible. If you have any questions, feel free to ask them on our new Opera extensions development forum.

A peek inside

For a gentle introduction to getting into Opera extensions plus an informative video, read our Come and play with Opera extensions article on Choose Opera. If you want to have a look inside an Opera extension and start playing around with some code, we recommend starting with our introductory What's in an Opera extension? article, and then continuing with the Hello World one, in which you learn how to make a simple extension.

API documentation

Apart from the standard web technologies Opera extensions are built on, there are also a number of unique APIs that come into play. These APIs allow programmers to talk to the browser and control browser functionality such as tabs and windows. We have made our extensions APIs as straightforward as possible, so that developers can pick them up quickly and easily.

Opera extension APIs exist in the opera.extensions namespace. opera.extensions is a global object which most API modules are built upon. For example, if you want to initialize the tabs object, you will write opera.extensions.tabs.

As a starting point, we recommend having a look at the API Documentation overview page, or alternatively, at our handy visual guide to the API docs.

We have also created a few API tutorials to get you started with Opera extensions APIs. They cover User Interface, Tabs, Windows and Messaging.

  • Opera extensions: buttons, badges and popups. This article introduces the ToolbarContext, ToolbarUIItem, ToolbarUIItemProperties, Popup and Badge objects. In this API article, you will learn more about creating UI for toolbars, including tooltips, icons and more.
  • Opera extensions: tabs. This article introduces the tabs object and explains how you can manipulate tabs.
  • Opera extensions: windows. This article introduces the windows object and explains how to manipulate windows.
  • Opera extensions: Messaging. Coming soon! This article introduces opera.extensions' postMessage method and the onconnect and onmessage handlers. You will learn how to send messages between scripts and popups.

Tutorials

Once you're somewhat familiar with the basic structure and different APIs, it's time to have a look at some hands-on tutorials. We're planning to add more in the weeks and months to come.

Known issues

  • Extensions don't work on pages without <script> tag nor on https pages (except if the user explicitly enables it in opera:config).
  • Use opera.postError() to debug the background process. This appears in View > Developer Tools > Error Console, rather than in Opera Dragonfly.

About this article

Published inDev.Opera
DateOctober 21, 2010
AuthorAndreas Bovens
Tagsarticles, API, opera extensions, download, builds, documentation, extensions
OriginalInternet Archive