Skip to content

Expose background load errors in options#9770

Closed
nightt5879 wants to merge 1 commit into
refined-github:mainfrom
nightt5879:nightt5879/issue-9767-background-error-message
Closed

Expose background load errors in options#9770
nightt5879 wants to merge 1 commit into
refined-github:mainfrom
nightt5879:nightt5879/issue-9767-background-error-message

Conversation

@nightt5879

Copy link
Copy Markdown

Summary

  • add a plain background loader entrypoint that captures synchronous service worker load failures before the built background module runs
  • store captured background load errors in extension storage so the options page can show the actual message/stack when the background ping fails
  • clear the loader listener once the background page finishes loading successfully

Fixes #9767

Validation

  • tsc --noEmit
  • rollup -c
  • eslint source/background-loader.js source/background.ts source/options.tsx source/options.html source/options.css rollup.config.js
  • dprint check source/background-loader.js source/background.ts source/manifest.json source/options.tsx source/options.html source/options.css rollup.config.js
  • biome lint source/background-loader.js source/background.ts source/options.tsx source/options.html source/options.css rollup.config.js
  • vitest --run
  • manually simulated a synchronous background load error against the built loader and confirmed backgroundPageLoadErrors stores the error message and stack

@github-actions github-actions Bot changed the title Expose background load errors in options AI SPAM Jul 1, 2026
@github-actions github-actions Bot closed this Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

This looks like an AI-generated PR, so we're preemptively closing it. If you're human and tested it, include a screenshot/video/gif of the working PR and we can reopen the PR. Don't open more PRs until this one is resolved.

@github-actions github-actions Bot added the meta Related to Refined GitHub itself label Jul 1, 2026
@nightt5879 nightt5879 changed the title AI SPAM Expose background load errors in options Jul 1, 2026
@nightt5879

Copy link
Copy Markdown
Author

I updated the branch to 00f41f9 and added local verification evidence for the background-load failure UI.

I loaded the built extension in Chrome for Testing 131 and verified the options page can render the stored background load error details under the existing failure banner:

Options page showing captured background load error

Checks run locally:

  • tsc --noEmit
  • rollup -c
  • targeted ESLint on the touched files
  • dprint check on the touched files
  • biome lint on the touched files
  • vitest --run (30 passed | 1 skipped, 533 passed | 31 skipped)

@nightt5879

Copy link
Copy Markdown
Author

I tried to reopen this PR after adding the verification screenshot, but GitHub rejected both the PR reopen and issue-state reopen calls from my side. Please reopen it if the evidence above is sufficient.

@fregante

fregante commented Jul 3, 2026

Copy link
Copy Markdown
Member

I'm also unable to reopen the PR because you force-pushed after the PR was closed.

You can open a new PR without using any PR tools (no "summary", "validation", no "checks run locally"). Just follow the PR template and it won't be closed

@fregante

fregante commented Jul 3, 2026

Copy link
Copy Markdown
Member

by the way a lot of changes will be needed, for example you can use

localStorage.backgroundLoadErrors ??= '';
localStorage.backgroundLoadErrors += error.stack + '\n\n';

and then just use this at the bottom of background.ts:

localStorage.backgroundLoadErrors = undefined;

No global functions needed.

Also since the background page errors are triggered long before the options page is opened, we no longer need messageRuntime either, just look for localStorage.backgroundLoadErrors

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

Labels

meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

Expose the actual background error message in the options page

2 participants