Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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?



Comments

  • `.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.
  • 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.
  • edited February 2017 Firefox
    ..
  • FWIW, Tampermonkey has GM_closeTab, GM_focusTab, GM_tabsGet, GM_tabsGetAll, GM_tabsSet

  • wOxxOm said:

    GM_closeTab, GM_focusTab, GM_tabsGet, GM_tabsGetAll, GM_tabsSet

    Good news! Does @arantius know about it?
  • I'm afraid to ask as I suppose he doesn't care at best or is against it at worst.

  • edited February 2017 Firefox
    wOxxOm said:

    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
  • edited February 2017 Chrome

    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.

  • edited March 2017 Firefox
    wOxxOm said:

    frozen for years

    maybe Alice can cure it ?
  • edited March 2017 Firefox
    small world of scriptwriters, hope you know, who is Alice
  • 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?
  • Late reply... didn't see a notification for it.

    Thanks but not just for personal usage. ^_^

  • // ==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... ;)
Sign In or Register to comment.