Skip to content

[Feature] Expose the current userscript UUID through GM_info.uuid #1784

Description

@0H4S

I'd like to request access to the current userscript's native UUID through GM_info.uuid and the equivalent GM.info.uuid property.

ScriptCat already maintains a UUID for each installed script. Exposing that existing identifier would give userscript developers a stable, documented way to identify the current installation during execution, without inspecting generated source code, editor URLs, or internal extension storage.

Suggested API:

const scriptUuid = GM_info.uuid;
// Equivalent alias:
const sameUuid = GM.info.uuid;

This would help developers:

  • Distinguish installed script instances without relying on names, versions, or URLs.
  • Coordinate work across tabs and execution contexts belonging to the same installation.
  • Build reusable libraries with consistent script identification.
  • Improve diagnostics and instance-specific state management.
  • Align with Violentmonkey, which already exposes GM_info.uuid.

The value should be the UUID ScriptCat already assigns to the current script, remain stable across page reloads and normal script updates, and be available wherever GM_info is provided. Access should be limited to the current script's identifier and require no additional permissions. It would not expose a hardware or browser-wide identifier.

It would also be helpful to document how the identifier behaves when scripts are duplicated, reinstalled, imported, restored, or synchronized, and include the property in ScriptCat's TypeScript definitions.

Reference: Violentmonkey GM_info documentation.

Thank you for considering this addition.

Activity

  1. CodFrm commented on Oct 8, 2026

    @CodFrm
    Member

    Sounds good. Let's keep this consistent with Violentmonkey.

  2. cyfung1031 commented on Oct 8, 2026

    @cyfung1031
    Collaborator

    @0H4S just wonder - any real application for this? uuid in ScriptCat is just random generation. even you install the same script in the same site, the uuid will not be the same.

    Distinguish installed script instances without relying on names, versions, or URLs.

    so this objective failed.

    Coordinate work across tabs and execution contexts belonging to the same installation.

    this is scriptcat's work, not your extension work.

    Build reusable libraries with consistent script identification.

    ???

    Improve diagnostics and instance-specific state management.

    how?

    Align with Violentmonkey, which already exposes GM_info.uuid

    This is ScriptCat not CopyCat. our uuid is not the same uuid as Violentmonkey. We need actual usage!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions