Skip to content

fix(sandbox): skip HTMLFencedFrameElement to avoid FencedFrame deprecation warning - #788

Merged
gioboa merged 2 commits into
QwikDev:mainfrom
tzdesign:fix/fencedframe-deprecation-warning
Oct 14, 2026
Merged

gioboa merged 2 commits into
QwikDev:mainfrom
tzdesign:fix/fencedframe-deprecation-warning

Conversation

@tzdesign

Copy link
Copy Markdown
Contributor

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

Description

Follow-up to #697 (#693, #694), same cause and same fix.

readMainInterfaces() creates one element per HTML*Element constructor on window to read its interface. In Chrome this includes HTMLFencedFrameElement, so a <fencedframe> is created inside partytown-sandbox-sw.html. Chrome reports this as a FencedFrame deprecation issue, and Lighthouse lists it under "Uses deprecated APIs", which lowers the Best Practices score of every page using Partytown 1.0.0.

This adds HTMLFencedFrameElement to DEPRECATED_WINDOW_PROPERTIES, so it is skipped like the Privacy Sandbox properties from #697.

Verified in Chrome 155 (DevTools issues read via CDP Audits.issueAdded, the same data the Issues panel and Lighthouse's deprecations audit use) on tests/platform/document-prod:

Trade-off: scripts in the worker now get a generic HTMLElement for <fencedframe> instead of HTMLFencedFrameElement, so fenced-frame-specific members like config are not available on the proxy ('HTMLFencedFrameElement' in window still returns true). In practice this only affects Privacy Sandbox ad scripts, and Chrome already marks the API as deprecated.

Use cases and why

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

…ation warning

readMainInterfaces() creates one element per HTML*Element constructor on
window to read its interface. For HTMLFencedFrameElement this creates a
<fencedframe> in the sandbox iframe, which Chrome reports as a "FencedFrame"
deprecation issue and Lighthouse penalizes under "Uses deprecated APIs".

Add it to DEPRECATED_WINDOW_PROPERTIES, following QwikDev#697.
@changeset-bot

changeset-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fb49fa0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@qwik.dev/partytown Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gioboa
gioboa force-pushed the fix/fencedframe-deprecation-warning branch from d9e6f84 to fb49fa0 Compare October 14, 2026 08:54

@gioboa gioboa 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 fix thanks 👏

@gioboa
gioboa merged commit fb63732 into QwikDev:main Oct 14, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
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.

2 participants