GM.openInTab: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
(→‎Returns: document return as of 0.8.2)
Line 22: Line 22:


As of [[Version_history#0.8.20090920.2|Greasemonkey 0.8.2]]: returns the <code>window</code> object created.
As of [[Version_history#0.8.20090920.2|Greasemonkey 0.8.2]]: returns the <code>window</code> object created.
As of [[Version_history#3.0|Greasemonkey 3.0]]: <code>undefined</code>.


== Examples ==
== Examples ==

Revision as of 21:06, 22 April 2015


Description

This method opens the specified URL in a new tab. As of Greasemonkey 0.8.2 it obeys the built in "When I open a link in a new tab, switch to it immediately" preference (browser.tabs.loadInBackground).

Compatibility: Greasemonkey 0.5b+

Syntax

function GM_openInTab( url )

Arguments

url
String The URL to navigate the new tab to.

Returns

Before version 0.8.2: undefined

As of Greasemonkey 0.8.2: returns the window object created.

As of Greasemonkey 3.0: undefined.

Examples

GM_openInTab("http://www.example.com/");