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.
The create()
method provides a way to create a new browser window. When the create()
method is invoked, the implementation must run the algorithm to create a window using tabs and properties as the argument, if provided.
tabs (optional)
: The tab, tab group or tab properties of the new window.properties (optional)
: The properties of the new window, such as its position/dimensions or whether it's private.BrowserWindow create (optional Object[] tabs, optional BrowserWindowProperties properties)
The following example creates a button in the browser toolbar. When the button is clicked, a new, empty browser window is created.
//
// The background process (e.g. index.html)
//
// Specify the properties of the button before creating it.
var UIItemProperties = {
disabled: false,
title: "Window creation test",
icon: "images/icon_18.png",
onclick: function() {
// Open a new browser window
opera.extension.windows.create();
}
};
// Create the button and add it to the toolbar.
var button = opera.contexts.toolbar.createItem( UIItemProperties );
opera.contexts.toolbar.addItem(button);