Skip to content

[BUG] Scripts randomly stops working due to deprecation of 'DOMSubtreeModified' mutation event #2007

@KohGeek

Description

@KohGeek

The issue was first reported here:
KohGeek/SortYoutubePlaylistByDuration#3

It's currently unknown whether Chrome Canary or Tampermonkey is at fault here, but I will describe the steps to reproduce as clear as I can.

Steps To Reproduce (Inconsistent)

Note

Subsequent testing with a complete clean Chrome Canary install cannot reproduce this.

  1. Ensure extension developer mode and TM is enabled
  2. Download any userscripts with prior versions
  3. Download the previous version of the userscript and set it to a position before the latest script
  4. Disable the old script
  5. Load the webpage, the extension should still behave as expected
  6. Restart the browser
  7. Load the webpage, the extension will now fail to load userscripts

Step one and step two maybe simplified down to scripts targeting the same page - but this is unknown.

Possible prerequisite

  • You may need to have upgraded Chrome from a previous version, with leftover browsing data.
  • A third disabled script targeting the same site may need to put behind the active script, basically sandwiching it.
  • You may need to enable Tamperscript before developer mode.

Expected Behavior

The disabled script remains disabled, and the enabled script will run.

Actual Behavior

Tampermonkey reports no script to be found - in fact, it reports no script for all other webpages.

Once TM enters this state, it may seem completely impossible to fix it. A list of things that have been tried:

  • Reenabling the scripts
  • Deleting all scripts and reinstalling them
  • Factory reset TM
  • Reinstall TM
  • Wipe all browsing data from Chrome
  • Factory reset Chrome
  • Downgrading TM
  • Switching to TM Beta

None of this will bring TM back into a functional state.

Temporary resolution

  • Switch settings to Advanced Mode
  • Switch the Inject mode from Default to Instant

Permanent resolution

  • Reinstall Chrome and delete all previous browsing data

Specifications

  • Chromium: Canary Version 124.0.6367.0 amd64, extension developer mode enabled
  • TM: 5.1.0
  • OS: Windows 11 22621.2715

Script

New version: https://github.com/KohGeek/SortYoutubePlaylistByDuration
Old version: https://gist.github.com/KohGeek/65ad9e0118ee5f5ee484676731bcd092/da58d22823f2c170c08346ec1c3dda238e3ca49c

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions