Menu

GM_openInTab

mmartz

Description

This API method opens the specified URL in a new background tab. Foreground loading may be globally overridden by setting the Mozilla preference about:config?filter=browser.tabs.loadInBackground to false.

| Examples | Notes

Syntax

GM_openInTab( url , option )

Value: Function
Returns: undefined
Compatibility: Greasemonkey 0.5 beta - 3.12.0
Access: @grant

Parameters

Properties
url
option
  • All properties are optional except url.

Properties


url

Value: String
Usage: url = "http://www.example.com/";

option

Compatibility: Greasemonkey 3.2.0+
Value: undefined, Boolean
Default: undefined
Usage:

option = true;

  • Force tab to background blur

option = false;

  • Force tab to foreground focus

Compatibility: Greasemonkey 3.4.0+
Value: undefined, Boolean (backward compatible), Object
Default: undefined
Usage:

option = undefined;
option = {};
option = { active: undefined, insert: undefined };

option = { active: true, insert: undefined };
option = { active: true };

option = { active: undefined, insert: true };
option = { insert: true };

option = { active: true, insert: true };

undefined (default behavior should honor browser configuration)

active

  • Force tab to foreground focus on true or tab to background blur on false

insert

  • Force tab to after current on true or tab to after last on false

Examples

Core

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

Notes


Related

Wiki: Greasemonkey_Manual:API
Wiki: Version_history