Skip to content

fix(truapi): treat Firefox's masked "null" ancestor origin as hidden#283

Merged
valentinfernandez1 merged 2 commits into
mainfrom
vf/firefox-null-ancestor-origin
Jul 16, 2026
Merged

fix(truapi): treat Firefox's masked "null" ancestor origin as hidden#283
valentinfernandez1 merged 2 commits into
mainfrom
vf/firefox-null-ancestor-origin

Conversation

@valentinfernandez1

Copy link
Copy Markdown
Collaborator

What

Firefox reports cross-origin ancestors in location.ancestorOrigins as the literal string "null". The sandbox bootstrap passed that straight to parent.postMessage as the targetOrigin for its truapi-ready ping, which throws SyntaxError: An invalid or illegal string was specified, so the handshake never completed and every TrUAPI call failed in Firefox iframe hosts. Chrome was unaffected because it reports the real ancestor origin.

resolveHostOrigin() now treats "null" as "host origin unknown" and uses the existing wildcard ready ping instead.

Firefox implements location.ancestorOrigins but serializes cross-origin
ancestors as the literal string "null", which resolveHostOrigin returned
verbatim; the sandbox bootstrap then threw SyntaxError ("An invalid or
illegal string was specified") from parent.postMessage and every client
call inside an iframe host failed. Treat "null" as an unknown host origin
and fall through to the source-checked wildcard ready ping so the
handshake completes on Firefox.
@valentinfernandez1
valentinfernandez1 marked this pull request as ready for review July 16, 2026 15:11
@valentinfernandez1
valentinfernandez1 requested a review from a team July 16, 2026 15:11

@TarikGul TarikGul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@valentinfernandez1
valentinfernandez1 added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit 6647131 Jul 16, 2026
12 checks passed
@valentinfernandez1
valentinfernandez1 deleted the vf/firefox-null-ancestor-origin branch July 16, 2026 15:37
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.

3 participants