MusicBrainz: Ajax Collection Links

Enhances entity sidebar collection links (Add/Remove from Collection) to use AJAX, preventing page reloads and toggling the link text on success.

这些是此脚本变更过代码的版本。 显示所有版本。

  • v1.1.0 2025-11-10

    refactor(ajax-collection-links): Use event delegation for collection links

    This commit refactors the event handling for the AJAX collection links to improve performance and robustness.

    Previously, the script queried for all collection links and attached an individual click event listener to each one using forEach.

    This has been replaced with a single, delegated event listener attached to the static #sidebar parent element. The handler now intelligently checks if the event.target (or its ancestor) is a matching collection link.

    This approach:

    • Is more performant, as it only requires one event listener regardless of the number of links.
    • Is more robust, as it will automatically handle any collection links that are dynamically added to the sidebar after the initial page load.
  • v1.0.3 2025-11-01

    feat(MusicBrainz Ajax Collection Links.user.js): update sidebar counter and prevent tab close on active request

    Implements two user experience improvements to the AJAX functionality:

    • Sidebar Counter: The script now updates the "Found in X user collections" counter in the sidebar immediately after a successful add/remove action. This provides instant visual feedback without requiring a page reload.

    Fixes #11

    • Tab Close Handling: Adds a beforeunload event listener to trigger the browser's confirmation prompt if the user tries to close the tab while a request is in progress.

    An unload listener is also added to set a flag, which suppresses the "Failed" error alert if the user intentionally proceeds with closing the tab (as this aborts the fetch request).

  • v1.0.2 2025-10-24

    fix: use @connect self where applicable

  • v1.0.1 2025-10-15

    fix: add icon

  • v1.0.0 2025-10-15

    fix: add icon

  • v1.0.0 2025-10-14 Imported from URL