Skip to content

append ancestorOrigins and baseOrigin to renderer URL. - #165

Open
jgindin wants to merge 3 commits into
mainfrom
fix-csp-origins
Open

append ancestorOrigins and baseOrigin to renderer URL.#165
jgindin wants to merge 3 commits into
mainfrom
fix-csp-origins

Conversation

@jgindin

@jgindin jgindin commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

The entire chain is necessary in case of multiple framings.

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

The entire chain is necessary in case of multiple framings.
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

⚡ A2UI Composer PR Preview

Your automated preview is successfully live (commit aebf11a):
👉 Launch PR Preview

Note: This environment will be wiped automatically when the PR is merged or closed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the RenderedFrame component to append both the parent and all ancestor origins to the renderer URL query parameters to prevent unauthorized cross-site framing, while deduplicating them. It also adds comprehensive unit tests for these scenarios, including SSR and Firefox environments. The review feedback suggests accessing ancestorOrigins using computed property syntax with a string literal to prevent TypeScript compilation errors and avoid minifier mangling.

Comment thread shell/src/app/preview/rendered/rendered-frame.ts Outdated
Uses computed property syntax `['ancestorOrigins']` with `any` cast to
prevent TypeScript compilation errors, as `ancestorOrigins` is not on
the standard Location interface. This also prevents JS optimizers such
as Closure Compiler or Terser from mangling or renaming the property
during production builds.
Replace any cast with explicit structural typing using DOMStringList.
Maintains string literal computed property access to protect against
minifier property mangling while removing the need for ESLint any
suppressions.
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