Tampermonkey / tampermonkey

Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.3k stars 424 forks source link

"No Script is Running" in Arc (Chromium) #1887

Open Chromagram opened 1 year ago

Chromagram commented 1 year ago

(Please fill out the issue template with your details)

Expected Behavior

Scripts that run in normal Chrome perfectly to run the same in a Chromium-style browser. In my case, it's Arc on the Mac. I'm unsure if the problem is the same on other Chromium browsers like Brave, or if it's an Arc issue.

Actual Behavior

Scripts tested in normal Chrome should appear and operate the same on different browsers that support Tampermonkey. Currently, not only do none of the scripts run, but they don't even detect in the panel. It just says "No Script is Running", when if you copy/paste the script into Tampermonkey on regular Chrome and visit the exact same page, it'll detect and run properly.

Specifications

Script

Here is just one of the scripts. It is designed to run specifically on a single Neopets.com page, solving the puzzle by itself there. On Chrome it does this no problem. On Arc (which runs Chromium), it's not detected at all and doesn't work. There are a pile of other scripts similar to this, and they all work on Chrome, but not Arc.

// ==UserScript== // @author Odd // @description Automatically solves the puzzle in the Mysterious Negg Cave. // @include https://www.neopets.com/shenkuu/neggcave/* // @name Mysterious Negg Cave Auto-Solver // @namespace Odd@Clraik // @version 1.0.2 // ==/UserScript==

var DelayMax = 10000; var DelayMin = 5000;

(function () {

if (typeof $ == "undefined") $ = unsafeWindow.$;

if (!$(".content img[src*='/neggcave/negg_final' i]").length) {

    var clue;
    var clues = [];
    var cluesfuS4L = 'DqEv32uzx';
    var i = 0;
    var j;
    var k;

    for (var match, tables = $(".mnc_clue_table"); i < tables.length; i++) {

        for (clue = [], k = 0; k < tables[i].rows.length; k++) {

            for (clue[k] = [], j = 0; j < tables[i].rows[k].cells.length; j++) {

                clue[k][j] = [3, 3];

                if (match = ($(tables[i].rows[k].cells[j]).find("> .mnc_negg_clue_cell:first").attr("class") || "").match(/s([\dx]+)c([\dx]+)$/i)) {

                    if (isNaN(clue[k][j][0] = parseInt(match[1]))) clue[k][j][0] = 3;

                    if (isNaN(clue[k][j][1] = parseInt(match[2]))) clue[k][j][1] = 3;
                }
            }
        }

        clues.push(clue);
    }

    if (clues.length) {

        i = 0;
        var solution;

        for (var l = (function () { for (j = 2, k = 1; j < 10; j++) k *= j; return k; })(), m, n, o, p; (i < l && !solution); i++) {

            for (clue = [], j = i, k = l, m = 9, solution = []; m; m--, j %= k)
                for (n = Math.floor(j / (k /= m)), o = p = 0; p < 9; p++)
                    if (solution[p] === undefined)
                        if (n == o++) (clue[(q = Math.floor(p / 3))] = (clue[q] || []))[(p % 3)] = solution[p] = (m - 1);

            for (j = 0; (j < clues.length && solution); j++) {

                for (k = (4 - clues[j].length); --k > -1;) {

                    for (m = (4 - clues[j][0].length); --m > -1;) {

                        for (n = 0; n < clues[j].length; n++) {

                            for (o = 0; o < clues[j][0].length; o++)
                                if ((clues[j][n][o][0] != 3 && clues[j][n][o][0] != (clue[(k + n)][(m + o)] % 3)) || (clues[j][n][o][1] != 3 && clues[j][n][o][1] != Math.floor(clue[(k + n)][(m + o)] / 3))) break;

                            if (o < clues[j][0].length) break;
                        }

                        if (n == clues[j].length) break;
                    }

                    if (m != -1) break;
                }

                if (k == -1) solution = null;
            }
        }

        if (solution) {

            unsafeWindow.NeggCave.resetGridConfirm();

            for (i = 0; i < solution.length; i++) {

                unsafeWindow.NeggCave.clickColor(-1);

                unsafeWindow.NeggCave.clickColor(Math.floor(solution[i] / 3));

                unsafeWindow.NeggCave.clickSymbol(-1);

                unsafeWindow.NeggCave.clickSymbol(solution[i] % 3);

                unsafeWindow.NeggCave.colorCell(Math.floor(i / 3), (i % 3));
            }

            var timeoutID;

            //GreaseMonkey compatible click
            document.getElementById("mnc_negg_submit_text")
                .addEventListener("click", function () {

                    if (timeoutID) {

                        clearTimeout(timeoutID);

                        timeoutID = null;
                    }
                });

            timeoutID = setTimeout(function () { unsafeWindow.NeggCave.submitGrid(); }, ((Math.random() * (DelayMax - DelayMin)) + DelayMin));

            return;
        }
    }

    alert("Oops! Couldn't solve the Mystery Negg Cave puzzle!");
}

})();

krystian3w commented 1 year ago

Maybe bug in Arc/Orion browser.

https://kagi.com/orion/

Chromagram commented 1 year ago

Thanks, is this something's that's confirmable or an estimate? I did also report it to Arc directly but they haven't noticed anything yet.

Also is Orion related? I don't have it myself.

derjanb commented 1 year ago

Can you please check whether the background page or the actual page developer console shows any errors?

In Chrome you can access the background page at "chrome://extensions" (Enable Developer mode and then click at "background.html" at the Tampermonkey secion").

Chromagram commented 12 months ago

Thanks, I opened up the dev console and did a little testing:

background.html and the Console tab inside the window does not show any changes at all. Tried viewing the two sections after refreshing a specific page that should have a script running on it, still nothing.

Bizarrely, a couple days after I opened this thread, it worked for a few days. I didn't change any settings or even close Arc, it just randomly started working perfectly. Today I had to restart my computer, which restarted Arc. Since then, I'm back to it not working.

Chromagram commented 12 months ago

Just a quick update aside:

I'm running most of scripts on Neopets.com, a site rife with outdated Flash games but also with plenty of normal pages that run no problem. I run a separate extension called Ruffle to restore Flash content support to the site.

There's one page I visit that forces me to open in a separate tab to load the Flash content. I just did that, and when I returned to the normal site, the scripts were running. I know this won't stay forever, so would still love to look into a more permanent fix. However, it's currently running and I'm hoping that info might help decipher where it's failing in the first place.

derjanb commented 11 months ago

Can you please check whether 5.0.6190 (crx) makes a difference? Please download the crx file linked above and drag and drop it to the extensions page chrome://extensions.

Chromagram commented 11 months ago

It looks like this is a separate beta plugin? I'll have to move all my scripts over and test it for a bit. As mentioned in the last comment, opening a specific Ruffle Flash fullscreen page and going back made the scripts work again temporarily. I'll try just using this plugin and seeing if it breaks at any point.