GM_openInTab causing odd behavior in Firefox 40

37 views
Skip to first unread message

Matt Sargent

unread,
Sep 4, 2015, 8:29:35 PM9/4/15
to greasemon...@googlegroups.com
I have a script, which a number of people use, which opens 10 tabs at once. This has been working fine for years now. Since Firefox 40, it's been behaving strangely. One of the 10 tabs will never finish loading. Pressing Escape will not halt the loading process. You cannot close the tab, and are forced to close the browser to get rid of it.

The example script just opens 5 tabs. The tab that won't finish, and the one to the left of it, cannot be closed. The original Google tab can be closed, but it will reappear either immediately, or when you again try to close one of the two "stuck" tabs. If one of the two tabs tries to close itself through javascript, it crashes the browser.

When I revert back to Firefox 39, all this weird behavior goes away, and everything works normally.

You can run the script from Google.com page. It add a link to the top. Change the number of tabs to open with the "j" variable.



// ==UserScript==
// @name        Test Script 33
// @namespace   http://gmscripts.locusprime.net
// @description Open Slashdot Tabs
// @include     http://www.google.com/
// @include     https://www.google.com/
// @version     01.00
// @grant       GM_openInTab
// ==/UserScript==

    var j = 5;
    var divMain = document.getElementById('main');
    var lnkOpener = document.createElement('a');
    lnkOpener.href = 'javascript:void(0)';
    lnkOpener.appendChild(document.createTextNode(`Click to open ${j} tabs`));
    lnkOpener.style.marginLeft = '100px';
    divMain.appendChild(lnkOpener);
    insertAheadOf(lnkOpener, divMain.firstChild);
   
    lnkOpener.addEventListener('click', open10tabs , false);
   
    function open10tabs() {
        for (var i = 0; i < j; i++) {
            GM_openInTab('http://slashdot.org/');
        }
    }
   
   
    function insertAheadOf(newElement, anchorElement) {
        anchorElement.parentNode.insertBefore(newElement, anchorElement);
    }
   


janekptacijarabaci

unread,
Sep 5, 2015, 5:26:51 AM9/5/15
to greasemonkey-users


Will be fixed in next version (Gresemonkey 3.4) - it's probably a bug in Firefox 40+.

Dne sobota 5. září 2015 2:29:35 UTC+2 Matt Sargent napsal(a):

Matt Sargent

unread,
Sep 6, 2015, 12:41:30 AM9/6/15
to greasemon...@googlegroups.com
Also, the open_in_background parameter for the GM_openInTab API is no longer working. It just ignores the value, and uses the browser default.


On 9/5/2015 4:26 AM, janekptacijarabaci wrote:

janekptacijarabaci

unread,
Sep 6, 2015, 1:27:45 AM9/6/15
to greasemonkey-users

Also this will be fixed in next version (Greasemonkey 3.4).

Dne neděle 6. září 2015 6:41:30 UTC+2 Matt Sargent napsal(a):
Reply all
Reply to author
Forward
0 new messages