GM openInTab

From GreaseSpot

Jump to: navigation, search
The correct title of this article is GM_openInTab. The substitution or omission of an _ is due to technical restrictions.



Image:Book.png
Greasemonkey Manual
Using Greasemonkey
Installing Scripts
Manage Dialog
Monkey Menu
User Script Authoring
Editing
Other Useful Tools
Environment
API
User Contributions
Code Snippets


[edit] Description

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

Examples | Notes

[edit] Syntax

GM_openInTab( url )

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

top

[edit] Properties


[edit] url

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

top | back

[edit] Examples

GM_openInTab("http://www.greasespot.net/");
top

[edit] Notes

[edit] 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

Personal tools