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.


The insert() method provides a way to insert a specified browser tab group or browser tab into this browser window, before the specified child, if provided.


  • tab / tabGroup: The tab or tab group to insert.
  • child (optional): The tab or tab group before which the specified tab or tab group should be inserted.


void insert (BrowserTabGroup tabGroup, optional BrowserTabGroup child)

void insert (BrowserTab tab, optional BrowserTabGroup child)

void insert (BrowserTab tab, optional BrowserTab child)


The following example creates a button in the browser toolbar. When the button is clicked, the currently selected tab is detected. Then, a new browser window is created and the tab is inserted into it.

// 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() {
    // Get the currently selected tab
    var thisTab = opera.extension.tabs.getSelected();

    // Open a new browser window
    var win =;

    // Insert the tab into the new window

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

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


No new comments accepted.