Packing and deploying your Opera Widget
By Opera Software · 13 Nov, 2006
- Previous article—Creating your first Opera Widget
- Next article—Opera Widgets Style Guide
- Table of contents
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.
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 that it is a requirement that all widgets have a close button.
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 addressbar which 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.
