feature element

By Opera Software

From Opera 15 onward, Opera 11 & 12’s extension format is no longer supported, and instead, we’ve switched to Chromium’s extension model. Check out our new documentation for developing extensions for Opera 15 and higher and start building your own extensions.

Description

The <feature> element declares the use of certain features by the extension, such as being able to display content in speed dial.

The following attributes are associated with the <feature> element:

  • name: defines which feature is requested (see below)
  • required: When this attribute is set to true it denotes that this feature is absolutely needed by the extension to function correctly. The required attribute is a boolean, with valid values as true or false. It is optional to include this attribute and if left out it will default to true

There are currently two features available to Opera extensions:

  • opera:speeddial: allows the extension to display content in a Speed Dial
  • opera:share-cookies: with this feature users won't have to be authenticated again if they are already signed in to the website your extension wants to connect to

Example

The below example shows an extension using both opera:share-cookies and opera:speeddial in order to display the latest messages from the user's account on my.opera.com:

<?xml version='1.0' encoding='utf-8'?>
<widget xmlns="http://www.w3.org/ns/widgets" version="1" viewmodes="minimized" id="http://my.opera.com/someblog">

  <name>Show recently received messages</name>

  <description xml:lang="en">Receive timely updates of your message activity on My Opera</description>
  <author>John Smith</author>
  <icon src="images/icon.64x64.png"/>

  <access origin="http://my.opera.com" subdomains="true"/>

  <feature name="opera:share-cookies" required="false"/>

  <feature name="opera:speeddial" required="true">
    <param name="url" value="http://my.opera.com"/>
  </feature>

</widget>

This article is licensed under a Creative Commons Attribution 3.0 Unported license.

Comments

  • photo

    izydoringwari

    Thursday, November 15, 2012

    This needs an update - being how "opera:contextmenus" is also available as a feature for extensions.
No new comments accepted.