GM.openInTab: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
Marti (talk | contribs)
m →‎Syntax: swap to JavaScript return type
Marti (talk | contribs)
m marking core sample code vs other sample code... full api syncback
Line 35: Line 35:


== Examples ==
== Examples ==
<code><pre>
{{Core samp |1=<pre style="border: none; margin: inherit;">
GM_openInTab("http://www.greasespot.net/");
GM_openInTab("http://www.greasespot.net/");
</pre></code>
</pre>}}


[[#top|top]]
[[#top|top]]

Revision as of 05:11, 7 May 2009

Template:Underscore


Greasemonkey Manual
Using Greasemonkey
Installing Scripts
Monkey Menu
Getting Help
User Script Authoring
Editing
Environment
API

Description

This API method opens the specified URL in a new background tab.

Examples | Notes

Syntax

GM_openInTab( url )

Value: Function
Returns: undefined
Compatibility: Greasemonkey 0.5b+
Parameters
Properties
url
  • All properties are optional except url.

top

Properties


url

Value: String
Usage: url = "http://www.greasespot.net/";

top | back

Examples

Template:Core samp

top

Notes

Referrer Issue

Opening webpages by invoking this method may not be the ideal choice, because this method doesn't save the referring page, which makes webservers think that you are calling a page only by it's URL, and not from the webpage it was on. In the cases where it doesn't work, one may use window.open(url) instead, which is similar in that it opens a new tab, but it keeps the referrer and switches to the tab immediately.

top