Developers › Dev.Opera

opera.contexts.toolbar.addItem()

December 6, 2011 · by Opera Software

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);

About this article

Published inDev.Opera
DateDecember 6, 2011
AuthorOpera Software
TagsButton and Badge, extensions API, Toolbar
OriginalInternet Archive