« Documentation Home

BrowserTab.private

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:

Attribute

The readonly private attribute exposes the privacy mode of the browser tab. On getting, the private attribute returns true if the privacy mode of the browser tab is private, otherwise it returns false.

Property

When specified as an item in a BrowserTabProperties object, the private property indicates the desired privacy mode of a browser tab. The value true indicates that the tab should be private, whereas the value false indicates that the tab's privacy mode should be normal.

When creating a browser tab, if this property is not specified, the default behaviour is to inherit the privacy mode of the context window.

When updating a browser tab, this property has no effect, whether specified or not. The privacy mode remains unchanged.

Syntax:

Attribute

readonly boolean private

Property

boolean private

Example:

The following example creates a button on the browser toolbar. When the button is clicked, a private tab is created with the specified URL.

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

// Specify the properties of the button before creating it.
var UIItemProperties = {
  disabled: false,
  title: "Example extension",
  icon: "images/icon_18.png",
  onclick: function() {
    // Create a tab properties object
    var tabProps = {
      url: 'http://www.operamail.com/',
      private: true
    };
    
    // Create a tab with the specified properties
    var tab = opera.extension.tabs.create(tabProps);
  }
};

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