GM.openInTab: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
open_in_background |
open_in_background verison note |
||
Line 17: | Line 17: | ||
: <code>String</code> The URL to navigate the new tab to. | : <code>String</code> The URL to navigate the new tab to. | ||
; <code>open_in_background</code> | ; <code>open_in_background</code> | ||
: <code>Boolean</code> Optional: force tab to/to not open in a background tab. Default (unspecified) behavior honors Firefox configuration. | : <code>Boolean</code> Optional: force tab to/to not open in a background tab. Default (unspecified) behavior honors Firefox configuration. (As of [[Version_history#3.2|Greasemonkey 3.2]].) | ||
== Returns == | == Returns == |
Revision as of 13:56, 29 May 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, open_in_background )
Arguments
url
String
The URL to navigate the new tab to.open_in_background
Boolean
Optional: force tab to/to not open in a background tab. Default (unspecified) behavior honors Firefox configuration. (As of Greasemonkey 3.2.)
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/");