fix(script-error): dedupe popups, richer errors, and deactivate rule #6

Merged
lksz merged 4 commits from fix/script-error-popup into dev 2026-10-27 04:00:43 +00:00
Owner

Summary

Hardens the Run JavaScript action failure UX: one popup per navigation, real exception details (including stack where Firefox Xray allows), and a Deactivate rule path so a broken script can be turned off without leaving the dialog stuck.

What changed

  • Deduplicate concurrent onCompleted / onHistoryStateUpdated handlers so a single navigation opens at most one script-error window.
  • Capture and pass JSON-serializable name / message / stack into the popup instead of Firefox’s opaque ERROR string; keep content-script Error builtins out of the page with scope so stacks aren’t blanked by Xray.
  • Script-error UI: expandable details (name/message/stack) and a Deactivate rule action on failure.
  • (If included after commit) Agent/project rule updates under .cursor/rules/ — optional; can ship separately.

Why

Script failures were noisy (duplicate windows), hard to debug (no useful exception text/stack), and awkward to recover from when a rule keeps failing. This makes failures actionable and quieter.

Verification

  • Load xpi.src/ via about:debugging and trigger a rule script that throws — confirm a single popup, readable details/stack, Deactivate works.
  • Confirm successful scripts still run with no popup.
  • ./build.sh --lint-only (or full build) if packaging/lint is required before merge.

Notes / deviations

  • Local working tree still has uncommitted xpi.src/* (and optional .cursor/rules/*); commit or drop before opening.
  • Target is dev per project workflow; do not target main.
## Summary Hardens the Run JavaScript action failure UX: one popup per navigation, real exception details (including stack where Firefox Xray allows), and a **Deactivate rule** path so a broken script can be turned off without leaving the dialog stuck. ## What changed - Deduplicate concurrent `onCompleted` / `onHistoryStateUpdated` handlers so a single navigation opens at most one script-error window. - Capture and pass JSON-serializable `name` / `message` / `stack` into the popup instead of Firefox’s opaque `ERROR` string; keep content-script `Error` builtins out of the page `with` scope so stacks aren’t blanked by Xray. - Script-error UI: expandable details (name/message/stack) and a **Deactivate rule** action on failure. - *(If included after commit)* Agent/project rule updates under `.cursor/rules/` — optional; can ship separately. ## Why Script failures were noisy (duplicate windows), hard to debug (no useful exception text/stack), and awkward to recover from when a rule keeps failing. This makes failures actionable and quieter. ## Verification - [x] Load `xpi.src/` via `about:debugging` and trigger a rule script that throws — confirm a single popup, readable details/stack, Deactivate works. - [x] Confirm successful scripts still run with no popup. - [ ] `./build.sh --lint-only` (or full build) if packaging/lint is required before merge. ## Notes / deviations - Local working tree still has uncommitted `xpi.src/*` (and optional `.cursor/rules/*`); commit or drop before opening. - Target is `dev` per project workflow; do not target `main`.
Deduplicate concurrent onCompleted/onHistoryStateUpdated handlers so a single incoming navigation opens at most one script-error window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Catch failures inside the injected wrapper and return JSON-serializable name/message/stack so the popup is not stuck with Firefox's opaque ERROR string.

Co-authored-by: Cursor <cursoragent@cursor.com>
feat(script-error): add Deactivate rule option on action failure
All checks were successful
PR Check / Check PR Target (pull_request) Has been skipped
PR Check / Lint (pull_request) Successful in 42s
PR Check / Build Preview (pull_request) Has been skipped
37ea7735ab
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(script-error): preserve call stacks and show expandable details
All checks were successful
PR Check / Check PR Target (pull_request) Has been skipped
PR Check / Lint (pull_request) Successful in 41s
PR Check / Build Preview (pull_request) Has been skipped
9331bb856a
Shadow Error builtins inside the with-block so Firefox Xray does not blank
stacks, and surface them in an expandable details panel.

Co-authored-by: Cursor <cursoragent@cursor.com>
lksz merged commit b933f60428 into dev 2026-10-27 04:00:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lksz/sticky-tabsz!6
No description provided.