Skip to content

DX improvements for third-party script developers#289

Draft
Kwack-Kwack wants to merge 2 commits intoManuito83:developfrom
Kwack-Kwack:dx
Draft

DX improvements for third-party script developers#289
Kwack-Kwack wants to merge 2 commits intoManuito83:developfrom
Kwack-Kwack:dx

Conversation

@Kwack-Kwack
Copy link
Copy Markdown
Collaborator

Ok, lets try this again...

Goals

GM Compatibility

  • @grant headers for GM_*, GM.* and PDA_* API access, as well as ###PDA-APIKEY### replacement. Requires notice for developers - this is a breaking change.
  • @require header support
  • Proper @match URL matching, rather than just a raw substring check
  • Full GM_* and GM.* compatibility with ViolentMonkey where possible. ViolentMonkey is open-source, whereas modern TamperMonkey is not, therefore it will be much easier to achieve full compat here
  • Proper version matching as per ViolentMonkey rather than loose string matching on invalid MAJOR.MINOR.MATCH

Script Installation

  • Improved userscript detection for the install widget
  • Better script update checks - once an hour?
  • Options for how to handle new versions - notify / auto update / update icon / don't auto-check.
  • Some form of "hot reload" for development. Must not auto-refresh the page on changes, as this is against the current scripting rules. Perhaps a toast, or just reload on each page load.
  • Warn user of @grant headers with a basic breakdown.

Runtime

  • Ability to connect to an external device for devtools
  • Widget with currently running scripts and registered menu commands
  • Better handling of serialisables in the console (fix [object Object] if possible)
  • Show the source of logs in the console if possible, at least when originating from scripts themselves (override the native console object?)

Documentation

  • Requirements for the script install widget
  • Steps for external devtools
  • PDA_* API
  • Hot reload

Currently a list of features that would be desirable. Some (GM_* compat) are more important than others (hot reload).

AlexTzib added a commit to AlexTzib/torn-pda that referenced this pull request Apr 15, 2026
- Add ScriptHeaderModel and VersionModel classes for proper version matching
- Add @grant header support to UserScriptModel
- Add @require header support to UserScriptModel
- Improve @match URL pattern matching with regex conversion
- Update UserScriptModel to use VersionModel for version comparison
- Add grants and requires fields to UserScriptModel
- Update parseHeader, fromJson, toJson, fromMetaMap methods
- Add comprehensive tests for new functionality
- Add documentation for GM compatibility features

Based on Kwack-Kwack's dx branch work
Manuito83 added a commit that referenced this pull request Apr 25, 2026
Implement GM compatibility features for PR #289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant