opera.contexts.toolbar.length

By Opera Software

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

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

Comments

No new comments accepted.