Getting started with Opera extensions
DEPRECATED: This article is deprecated. We recommend using our quick documentation overview instead.
To get you started, we've prepared API reference guides, as well as a number of articles and tutorials. There is a quick documentation overview if you want to have a structured, TOC-like outline of what is available. This article covers the same documentation pointers, but in a more contextualized fashion.
If you have any questions, feel free to ask them on our Opera extensions development forum.
If you want to have a peek 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 continue with the Hello World one, in which you learn how to make a simple extension.
Also be sure to have a look at the developer workflow article, so you can make optimal use of the developer features we've included for your convenience.
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 is a global object which most API modules are built upon. For example, if you want to initialize the
tabs object, you will write
As a starting point, we recommend having a look at the Opera Extensions API guides page. You can then further dig down and inspect the guides to Messaging, the Browser Toolbar, config.xml elements and attributes, Injected Scripts, Popups, Speed Dial, Windows and Tabs and the URL Filter API.
API and packaging tutorials
We have also created a few tutorials to go with the API guides mentioned above. They cover config.xml, User Interface, Tabs, Windows, Messaging, the Options page and the URL Filter API.
- The ins and outs of config.xml: In this article we build up a complete configuration document, showing step by step what all the different elements and attributes do.
- Buttons, badges and popups: This article introduces the
Badgeobjects: you will learn more about creating UI for toolbars, including tooltips, icons and more.
- Tabs: This article introduces the
tabsobject and explains how you can manipulate tabs.
- Windows: This article introduces the
windowsobject and explains how to manipulate windows.
- Messaging: This article introduces
postMessagemethod and the
onmessage handlers. You will learn how to send messages between scripts and popups.
- Options page: This article explains how you can create a nicely integrated preferences page for your extension, and includes a template which you can use in your own extension.
- Site blocking with Opera’s URL Filter API: Opera's URL Filter API allows you to easily implement features in extensions that restrict access to certain domains, on a temporary or permanent basis. This article explains the concept, syntax basics and how to build a simple extension using this API.
- Accessing an Opera extension's background process: This article explains how to make optimal use of the bgProcess object, allowing you to avoid messaging in many cases.
Extension building tutorials and templates
Once you're somewhat familiar with the basic structure and different APIs, it's time to have a look at some hands-on tutorials and templates.
- Opera extensions prototypes for modifying CSS: this article introduces three Opera extension templates, which you can use to build your own Opera extension that modifies a page's CSS.
- Opera extension code examples: this article introduces a number of code snippets for basic extension functionality.
- Converting UserJS to Opera extensions: this article teaches you how to convert an existing Opera UserJS into an Opera extension.
- Creating Opera Speed Dial extensions: this article covers all the things you need to know for creating Speed Dial extensions.
- Creating multilingual extensions: this article explains how you can make optimal use of the extension packaging format's built-in mechanisms for providing multilingual versions of an extensions.
UI guidelines and distribution
- Publishing guidelines: This guide explains how to make sure your extension is of high quality and shines, so as to get it published on the Opera extensions catalog.
- Distributing Opera extensions and auto-updates: This article talks about methods of distributing your Opera extensions, covering the Opera extensions catalog, MIME type settings if you distribute on your own, and the auto-update mechanism.
This article is licensed under a Creative Commons Attribution 3.0 Unported license.