Popup.width

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:

The width of the popup window; by default, the width is 300px. Note that this attribute is set in the background script as part of the ToolbarUIItemProperties object. See the Browser Toolbar guide.

Syntax:

Number width

Example:

//
// The background process (e.g. '/background.js').
//

// Set options for the button
var UIItemProperties = {
  disabled: false,
  title: 'Opera Extension',
  icon: 'images/icon_18.png',
  popup: {
    href: 'popup.html'
  }
};

// Set the popup's height to 480 pixels
UIItemProperties.popup.width = 200;

// Create the button and add it to the toolbar
var button = opera.contexts.toolbar.createItem(UIItemProperties);
opera.contexts.toolbar.addItem(button);

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

Comments

No new comments accepted.