« Documentation Home

opera.contexts.toolbar.length

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

This attribute contains the number of UI items held by the ToolbarContext. Note: The ToolbarContext is currently restricted to a maximum of one UI item, so this will be either 1 or 0.

Example:

This attribute is useful for checking whether a button is being displayed in the toolbar or not.

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

// Is there a button in the toolbar?
if (opera.contexts.toolbar.length) {
  var buttonExists = true;
} else {
  var buttonExists = false;
}