« Documentation Home

BrowserWindow.parent

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:

The readonly parent attribute exposes the parent window.

Syntax:

readonly BrowserWindow parent

Example:

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

// Set the button's properties
var properties = {
  disabled: false,
  title: "My Test Extension",
  icon: "icon.18x18.png",
  badge: {
    backgroundColor: '#CC5555',
    color: 'white',
    textContent: '!',
    display: 'none'
  }
};	

// Add the button to the browser UI
var button = opera.contexts.toolbar.createItem(properties);
opera.contexts.toolbar.addItem(button);

// Listen for injected script messages
opera.extension.onmessage = function(event) {
  // Show the badge if we get a warning from the injected script
  if (event.data === 'warning') {
    button.badge.display = 'block';
  } else {
    button.badge.display = 'none';
  }
}