« Documentation Home

Widget object

This documentation relates to Opera's now deprecated .oex Extension API framework for Opera versions <= 12.15 and also provided by our OEX2NEX shim library.

For the latest Opera Extensions API documentation for Opera versions > 12.15 please consult the latest Opera Extensions API documentation online.

widget.author
A readonly attribute referring to the extension's author.
widget.authorEmail
A readonly attribute referring to the extension author's email address.
widget.authorHref
A readonly attribute referring to the extension author's website URL.
widget.description
A readonly attribute referring to the extension's description.
widget.id
A readonly attribute referring to the extension's unique ID.
widget.name
A readonly attribute referring to the extension's name.
widget.preferences
Readonly attributes that refer to the extension's preferences in key/value format.
widget.shortName
A readonly attribute referring to a shortened version of the extension's name.
widget.version
A readonly attribute referring to the extension's version number.

Overview

The widget object provides functionality for accessing an extension's metadata and persistently-stored data. It can be accessed from any of the extension's environments, such as background process, popup window, injected script or preferences page. Note that the widget object is readonly and therefore cannot be used to edit or store values on-the-fly.

Example

The below example shows how simple it is to access data within the widget object.

//
// The preferences page (e.g. options.js)
//

var footer = 'This extension is the work of <a href="' + widget.authorHref + '">' + widget.author + '</a>';
document.body.innerHTML += footer;