Discussions » Development

Another way to Open Tab without Focus beside GM_openInTab

§
Posted: 2017-02-02

Another way to Open Tab without Focus beside GM_openInTab

I am trying to open a tab without focus and also be able to close it afterwards. GM_openInTab allows me to open a tab without focus but I can no longer close it.`.close()` no longer works on the if you use GM_openInTab.

Any other way to open tab without focus?

§
Posted: 2017-02-02
`.close()` no longer works on the if you use GM_openInTab.

I struggled with this problem, I had frustration. Browser security forbids close() issued from script.

§
Posted: 2017-02-03

It's a pain. I am thinking of turning off the security.

Someone has suggested a GM_closeTab but it's been on to do list since 2013.

§
Posted: 2017-02-03
Edited: 2017-02-03

..

wOxxOmMod
§
Posted: 2017-02-22

FWIW, Tampermonkey has GMcloseTab, GMfocusTab, GMtabsGet, GMtabsGetAll, GM_tabsSet

§
Posted: 2017-02-22
GM_closeTab, GM_focusTab, GM_tabsGet, GM_tabsGetAll, GM_tabsSet

Good news! Does @arantius know about it?

wOxxOmMod
§
Posted: 2017-02-23

I'm afraid to ask as I suppose he doesn't care at best or is against it at worst.

§
Posted: 2017-02-24
Edited: 2017-02-24
I'm afraid to ask

попытка - не пытка, однако
I meant - if the question is correctly formulated , @arantius will be obliged to answer it, the more so, as I recall, the question about GM_closeTab arises not the first time

wOxxOmMod
§
Posted: 2017-02-24
Edited: 2017-02-24

Go ahead, ask. I think GM API has been essentially frozen for years. That's probably one of the reasons Scriptish addon appeared. Too bad it seems to be completely dead.

§
Posted: 2017-02-24
Edited: 2017-03-05
frozen for years

maybe Alice can cure it ?

§
Posted: 2017-02-24
Edited: 2017-03-05

small world of scriptwriters, hope you know, who is Alice

§
Posted: 2017-03-02

If this is for personal use...

How about window.open() with the following set in about:config --

browser.link.open_newwindow => 3 (default setting)
browser.tabs.loadDivertedInBackground => true

-- does that work in a userscript?

§
Posted: 2017-03-31

Late reply... didn't see a notification for it.

Thanks but not just for personal usage. ^_^

§
Posted: 2017-05-03


// ==UserScript==
// @name Test
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author n/a
// @match https://greasyfork.org/en/forum/discussion/16463/another-way-to-open-tab-without-focus-beside-gm-openintab*
// @grant GM_openInTab
// ==/UserScript==

(function() {
'use strict';

var mmkay = GM_openInTab("https://www.kongregate.com", true);
setTimeout(function() {mmkay.close();}, 5000);
})();


Works in chrome... ;)

Post reply

Sign in to post a reply.