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.


This property represents the icon for the Button. It can reference the relative path to a data URI, an image located inside the package, or it can point to an external URL.


The below example changes the button icon on each click.

// The background process (e.g. index.html)

// Create a button and add it to the browser UI
var properties = {
  title: "My Extension",
  icon: "icon.18x18.png",
var button = opera.contexts.toolbar.createItem(properties);

// Track how many times the button has been clicked
var i = 1;

// Handle button clicks
button.addEventListener('click', handleClick, false);

// Change the icon to 'icon2' every time the click count is an even number
function handleClick() {
  if (i % 2 == 1) {
    button.icon = "icon2.18x18.png";
  } else {
    button.icon = "icon.18x18.png";

  // Increase the click count

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


No new comments accepted.