Packing and deploying your Opera Widget

By Opera Software

24th April 2012: Please note

Starting with Opera 12, Opera Widgets will be turned off for new users and completely removed in a later release. If you're interested in building addons for Opera, we recommend going with our extensions platform — check out our extensions documentation to get started.

Introduction

When your widget is finished, what remains is to deploy it, and make it available for all to see. This article explains how.

Packing

Widgets are packed using the zip format (using .wgt extension), with the config.xml and index.html in the root folder of the archive. Any other files you use in the widget can be located anywhere within the widget archive file. For example, to package a standard widget you would:

  1. Have a widget folder containing at least a config.xml file and a main HTML file, usually named index.html
  2. Zip these files and any other necessary files or folders in your widget folder
  3. Rename the zip file from .zip to .wgt

That's it! It's now ready to install, send to others or upload to our repository.

Publish on Opera’s widget repository site

The easiest way to deploy your widget and make it available to millions of users is to upload it to Opera’s widget repository web site, where Opera widget users will have access to your widget in a matter of hours.

Widgets uploaded to the widget repository are reviewed by Opera staff before the become available for end users. If there is a problem, you’ll receive a message explaining what the issue is. Please note the widgets style guide, which you should follow for a more consistent Widget user experience.

Publish on your own web site

If you wish to deploy the widget on your own server, it should be served with the Content-Type: application/x-opera-widgets. For the Apache HTTP server add the following to a .htaccess file in the folder where the widget is stored:

AddType application/x-opera-widgets .wgt

To make a widget icon appear in Opera’s address bar, add the below code to the head-section of your HTML document. Opera will display a widget icon in the address bar that the user can click to run the widget.

<link rel="alternate"
  type="application/x-opera-widgets"
  title="[widget name]"
  href="[widget url]" />

Running a deployed widget

Provided the widget is served with the correct Content-Type, Opera will automatically ask the user whether he/she wants to install the widget when the user clicks on a widget on a Web page. When the widget is deployed on the Opera Widgets site, the end-user can easily find and download your widget from the “Add Widget” entry in Opera’s Widget menu.

This article is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported license.

Comments

The forum archive of this article is still available on My Opera.

No new comments accepted.