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.36k stars 428 forks source link

Problem with autopager script #968

Closed alexolog closed 4 years ago

alexolog commented 4 years ago

The Super_preloaderPlus_one_New script automatically loads the next page on web site.

It exhibits a problem on certain forum threads that are not visible to unregistered guests where the loaded pages are not passed the user's credentials, but only when running under TM. Greasemonkey works OK.

Example:

  1. Install https://greasyfork.org/en/scripts/33522-super-preloaderplus-one-new
  2. Go to https://www.trektraxs.com/index.php?topic=8951.0 (username: tampermonkey, password: Tampermonkey4)
  3. Scroll to the end of the page

Expected Behavior

Under GM, the next page is loaded beneath the first one.

Actual Behavior

Under GM, the "login" page is loaded beneath the first one.

Specifications

Script

https://greasyfork.org/en/scripts/33522-super-preloaderplus-one-new

I suspect the problem is in the handling of the GM.xmlHttpRequest call or the polyfill.

derjanb commented 4 years ago

The scripts contains this comment:

    } // `options.cookie`, dirty fix for TM and VM on Firefox
    // TODO: remove when TM and VM releases new version

Without

        options.cookie = document.cookie;

the script is working fine here.

Please report this back to the script developer. Thanks.

alexolog commented 4 years ago

Thanks!

I believe a better place to fix it is:

    if (BROWSER.name === 'firefox') {
      if (SCRIPT_MANAGER.name === 'Violentmonkey' && compareVersions(SCRIPT_MANAGER.version, '2.12.3') <= 0 || SCRIPT_MANAGER.name === 'Tampermonkey') {
        // `options.cookie`, dirty fix for TM and VM on Firefox
        // TODO: remove when TM releases new version
        logger.warn("[Super-preloader]", `${SCRIPT_MANAGER.name}  v${SCRIPT_MANAGER.version} has a flaw on Firefox, which may affect this script`);
        logger.warn("[Super-preloader]", 'Check https://github.com/Tampermonkey/tampermonkey/issues/786 and https://github.com/violentmonkey/violentmonkey/issues/606 to learn more');
        gotConfig.cookie = true;
      }
    }

Can you suggest a TM version for the backward compatibility?

alexolog commented 4 years ago

Never mind: 4.10.6103