opera.contexts.toolbar.addItem()

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

This method adds a Button to the toolbar in the browser. To create a Button see the createItem method.

Parameters:

  • item: The Button to be added.

Syntax:

void addItem (<Button> item)

Example:

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

// Create a button
var button = opera.contexts.toolbar.createItem({
  title: 'Weather Extension',
  icon: 'yr.png'
});

// Add it to the browser UI
opera.contexts.toolbar.addItem(button);

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

Comments

No new comments accepted.