I'm facing an issue with Greasemonkey 3.17 on FF56 and Tampermonkey on Vivaldi that doesn't seem to have any solution on Google.
Here's an example script:
// ==UserScript==
// @name stackoverflow.com
// @namespace siod87gbnwf87rnsfdkn
// @include https://stackoverflow.com/*
// @version 1
// ==/UserScript==
alert(1);
alert(2);
It's a simple script that should display one message box followed by another after clicking OK. The issue arises when performing the following steps:
Visit stackoverflow.com
Open a question in a new tab using the middle mouse button twice rapidly, so that the second tab opens as the first one is still loading
Both tabs will display "1" in the popup box, but you'll notice that upon clicking OK on the first tab, the script pauses until you click OK on the second tab as well. Only after dealing with both popups from the second tab will the alert
on the first tab trigger.
Why aren't the scripts running independently of each other? This behavior isn't specific to alert
, as I've encountered the same issue with more complex scripts. However, for demonstration purposes, the alert function illustrates the problem effectively.