GM.openInTab: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
m →Description: Noted about foreground loading in 0.8.2... btw I get "Error: Permission denied..." when I try to use any object on the returned window handle in 3.5.3 ... sf |
|||
Line 5: | Line 5: | ||
== Description == | == Description == | ||
This [[API_reference|API]] method opens the specified URL in a new background tab. | This [[API_reference|API]] method opens the specified URL in a new background tab. Foreground loading may be globally overridden by setting the Mozilla preference <code>browser.tabs.loadInBackground</code> to <code>false</code> in [http://kb.mozillazine.org/About:config about:config]. | ||
[[#Examples|Examples]] | [[#Notes|Notes]] | [[#Examples|Examples]] | [[#Notes|Notes]] |
Revision as of 04:48, 28 September 2009
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. Foreground loading may be globally overridden by setting the Mozilla preference browser.tabs.loadInBackground
to false
in about:config.
Syntax
GM_openInTab( url )
- Value: Function
- Returns: undefined
- Compatibility: Greasemonkey 0.5b+
Parameters Properties url
- All properties are optional except url.
Properties
url
- Value: String
- Usage:
url = "http://www.greasespot.net/";
Examples
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.