sync: dev to extern-contrib

Merged
GI
5mo ago
+66-9

sync-branches: New code has just landed in dev, so let's bring extern-contrib up to speed!

Summary by Sourcery

Sync extern-contrib userscript with latest dev changes and improve initialization flow.

New Features:

  • Allow early-returning from auto-login and profile checks to avoid running script logic when not logged in or redirected.

Bug Fixes:

  • Prevent CurrentUsername, SearchParams, and initTheme from being undefined by declaring them before asynchronous initialization.
  • Ensure script initialization works under Violentmonkey by wrapping async startup logic in an async IIFE instead of relying on top-level await.
  • Avoid accessing #profile when it is absent by checking and returning early, preventing errors on pages without a profile element.

Enhancements:

  • Improve script startup logging and error handling by awaiting main and capturing initialization errors in a catch block.
  • Bump script and package versions from 3.4.6 to 3.5.1 to reflect the latest changes.

Summary by cubic

Sync extern-contrib with dev to release 3.5.1. Fix Violentmonkey top-level await error, harden init/login flow, and update version and release metadata (3.5.0/3.5.1).

  • Bug Fixes
    • Wrapped async init in an IIFE to make await valid in Violentmonkey.
    • Predeclared CurrentUsername, initTheme, and SearchParams; added early returns for login/profile checks to avoid undefined access and redirect loops.
    • Awaited main() and added init error logging.
    • Bumped to 3.5.1 and added 3.5.0/3.5.1 entries in Update.json.