[PR #4320] [MERGED] Support explicitly trusted full-page extensions #6331

Closed
opened 2026-10-23 04:09:26 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4320
Author: @SpicyMarinara
Created: 7/30/2026
Status: ✅ Merged
Merged: 7/30/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/full-page-external-extensions


📝 Commits (4)

  • 17056b7 Add opt-in full-page extension runtime
  • 55bfa41 Document and verify full-page extension trust
  • 6874991 Address full-page extension lifecycle review
  • 1256d80 Clean up failed full-page extension loads

📊 Changes

18 files changed (+812 additions, -134 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 README.md (+1 -1)
📝 docs/CONFIGURATION.md (+2 -0)
📝 docs/FAQ.md (+4 -2)
📝 docs/TROUBLESHOOTING.md (+8 -0)
📝 docs/development/personal-extensions.md (+15 -8)
📝 docs/extending/personal-extensions.md (+29 -12)
📝 packages/client/src/components/layout/PersonalExtensionInjector.tsx (+240 -6)
📝 packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx (+227 -71)
📝 packages/client/src/hooks/use-personal-extensions.ts (+10 -1)
📝 packages/client/src/lib/personal-extension-import.ts (+13 -1)
📝 packages/client/src/lib/personal-extension-transfer.ts (+3 -1)
📝 packages/client/src/localization/locales/en.json (+10 -4)
📝 packages/server/src/routes/personal-extensions.routes.ts (+74 -1)
📝 packages/server/src/services/extensions/personal-extension-storage.service.ts (+36 -17)
📝 packages/shared/src/schemas/personal-extension.schema.ts (+1 -0)
📝 packages/shared/src/types/personal-extension.ts (+9 -2)
📝 scripts/regressions/extension-security.regression.ts (+129 -7)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #4319

Why this change

  • Legacy Marinara browser extensions such as WeatherTweaker v2.1.0 can be imported today, but their DOM-dependent behavior silently fails inside the safe Worker sandbox.
  • Users who deliberately allow third-party extensions need an honest, explicitly approved compatibility path without weakening the sandbox used by ordinary Browser Extensions.

What changed

  • Keeps the opaque-origin Worker sandbox as the default Browser Extension runtime.
  • Recognizes pre-sandbox marinara.extension v1 packages without a capabilities declaration as requesting full_page_access; modern exports always write an explicit capabilities list.
  • Adds an external-only, exact-hash-gated page runtime and optional page stylesheet route behind both External Extension gates.
  • Requires a separate server-side acknowledgement and presents an unmistakable whole-session risk disclosure, destructive warning treatment, and list badge.
  • Prevents Professor Mari drafts from requesting or retaining Full page access.
  • Performs best-effort cleanup for injected nodes, compatibility timers, private storage, and registered cleanup callbacks while warning that a reload may be necessary.
  • Updates maintainer and user documentation; translation follow-up is tracked by #4321.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated validation completed:

  • pnpm check
  • pnpm regression:extensions-security
  • pnpm regression:docs
  • Targeted desktop Playwright smoke for the three existing extension lock/migration/settings flows (3 passed)
  • Static import of the WeatherTweaker v2.1.0 release asset, confirming it becomes a disabled full_page_access Browser Extension with all JS/CSS preserved

Manual verification notes

  • Manually import WeatherTweaker v2.1.0 with External Extensions enabled, review the Full page access disclosure, approve its exact hash, and verify its toolbar and weather controls operate.
  • Manually disable WeatherTweaker and reload once to verify both best-effort cleanup and a clean restarted page.
  • Manually verify a sandboxed Browser Extension still runs without DOM, origin, storage, or network authority.
  • Manually verify closing either External Extensions gate stops both sandboxed and full-page third-party extensions.

The downloaded WeatherTweaker artifact was inspected and parsed but not executed as part of automated validation.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • The review surface uses the existing responsive Addons editor and confirmation dialog; manual WeatherTweaker evidence remains in the test plan above.

Summary by CodeRabbit

  • New Features
    • Added optional Full page access for trusted legacy Browser Extensions, enabling DOM compatibility outside the sandbox.
    • Added permission indicators, approval confirmations, capability labels, and legacy package handling.
    • Improved full-page extension loading, styling, runtime cleanup, and lifecycle management.
  • Documentation
    • Expanded setup, security, FAQ, configuration, and troubleshooting guidance.
    • Clarified sandbox limitations, approval requirements, reload steps, and trusted-code considerations.
  • Bug Fixes
    • Improved handling of access requests, imports, approvals, and persistent runtime effects.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4320 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/30/2026 **Status:** ✅ Merged **Merged:** 7/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/full-page-external-extensions` --- ### 📝 Commits (4) - [`17056b7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/17056b700a6a319b629748ef7fa5cdb93229f3bc) Add opt-in full-page extension runtime - [`55bfa41`](https://github.com/Pasta-Devs/Marinara-Engine/commit/55bfa41ca5898765ec619afdf89274806ac02618) Document and verify full-page extension trust - [`6874991`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6874991d7f4cedacfa4d33ee5f6e92bde4879174) Address full-page extension lifecycle review - [`1256d80`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1256d80a03fcfd45e3808daa44e1eb11f0e65a09) Clean up failed full-page extension loads ### 📊 Changes **18 files changed** (+812 additions, -134 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `README.md` (+1 -1) 📝 `docs/CONFIGURATION.md` (+2 -0) 📝 `docs/FAQ.md` (+4 -2) 📝 `docs/TROUBLESHOOTING.md` (+8 -0) 📝 `docs/development/personal-extensions.md` (+15 -8) 📝 `docs/extending/personal-extensions.md` (+29 -12) 📝 `packages/client/src/components/layout/PersonalExtensionInjector.tsx` (+240 -6) 📝 `packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx` (+227 -71) 📝 `packages/client/src/hooks/use-personal-extensions.ts` (+10 -1) 📝 `packages/client/src/lib/personal-extension-import.ts` (+13 -1) 📝 `packages/client/src/lib/personal-extension-transfer.ts` (+3 -1) 📝 `packages/client/src/localization/locales/en.json` (+10 -4) 📝 `packages/server/src/routes/personal-extensions.routes.ts` (+74 -1) 📝 `packages/server/src/services/extensions/personal-extension-storage.service.ts` (+36 -17) 📝 `packages/shared/src/schemas/personal-extension.schema.ts` (+1 -0) 📝 `packages/shared/src/types/personal-extension.ts` (+9 -2) 📝 `scripts/regressions/extension-security.regression.ts` (+129 -7) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #4319 ## Why this change - Legacy Marinara browser extensions such as WeatherTweaker v2.1.0 can be imported today, but their DOM-dependent behavior silently fails inside the safe Worker sandbox. - Users who deliberately allow third-party extensions need an honest, explicitly approved compatibility path without weakening the sandbox used by ordinary Browser Extensions. ## What changed - Keeps the opaque-origin Worker sandbox as the default Browser Extension runtime. - Recognizes pre-sandbox `marinara.extension` v1 packages without a capabilities declaration as requesting `full_page_access`; modern exports always write an explicit capabilities list. - Adds an external-only, exact-hash-gated page runtime and optional page stylesheet route behind both External Extension gates. - Requires a separate server-side acknowledgement and presents an unmistakable whole-session risk disclosure, destructive warning treatment, and list badge. - Prevents Professor Mari drafts from requesting or retaining Full page access. - Performs best-effort cleanup for injected nodes, compatibility timers, private storage, and registered cleanup callbacks while warning that a reload may be necessary. - Updates maintainer and user documentation; translation follow-up is tracked by #4321. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated validation completed: - `pnpm check` - `pnpm regression:extensions-security` - `pnpm regression:docs` - Targeted desktop Playwright smoke for the three existing extension lock/migration/settings flows (3 passed) - Static import of the WeatherTweaker v2.1.0 release asset, confirming it becomes a disabled `full_page_access` Browser Extension with all JS/CSS preserved ### Manual verification notes - Manually import WeatherTweaker v2.1.0 with External Extensions enabled, review the Full page access disclosure, approve its exact hash, and verify its toolbar and weather controls operate. - Manually disable WeatherTweaker and reload once to verify both best-effort cleanup and a clean restarted page. - Manually verify a sandboxed Browser Extension still runs without DOM, origin, storage, or network authority. - Manually verify closing either External Extensions gate stops both sandboxed and full-page third-party extensions. The downloaded WeatherTweaker artifact was inspected and parsed but not executed as part of automated validation. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - The review surface uses the existing responsive Addons editor and confirmation dialog; manual WeatherTweaker evidence remains in the test plan above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added optional **Full page access** for trusted legacy Browser Extensions, enabling DOM compatibility outside the sandbox. * Added permission indicators, approval confirmations, capability labels, and legacy package handling. * Improved full-page extension loading, styling, runtime cleanup, and lifecycle management. * **Documentation** * Expanded setup, security, FAQ, configuration, and troubleshooting guidance. * Clarified sandbox limitations, approval requirements, reload steps, and trusted-code considerations. * **Bug Fixes** * Improved handling of access requests, imports, approvals, and persistent runtime effects. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:09:26 +07:00
Sign in to join this conversation.
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
Pasta-Devs/Marinara-Engine#6331
No description provided.