« Documentation Home

icon element

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.

Description

If any .svg, .ico, .png, .gif or .jpg file with the name "icon" is present in the extension package (for example: 'icon.png'), then that is used as the icon for the extension by default.

The <icon> element is used to specify a custom icon file for the extension. The width and height attributes are not needed for SVG files. For bitmaps (e.g., png, gif, etc), Opera will automatically deduce the width and height of each icon.

Example

In the following example, two icon sizes are specified. The 64px icon is used in Opera's extension manager and the 18px icon (optional) is the size used for toolbar buttons.

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" id="http://example.com/myExtension" version="1.0">
  ...
  <icon src="images/icon_64.png"/>
  <icon src="images/icon_18.png"/>
  ...
</widget>

Further reading

As part of our extension documentation, we have a collection of hints and tips for creating effective extension icons.