Skip to content

AO3-7342 Update embed sanitizer to new Allow syntax#5646

Open
not-varram wants to merge 2 commits intootwcode:masterfrom
not-varram:AO3-7342
Open

AO3-7342 Update embed sanitizer to new Allow syntax#5646
not-varram wants to merge 2 commits intootwcode:masterfrom
not-varram:AO3-7342

Conversation

@not-varram
Copy link
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-7342

Purpose

Support the modern allow="fullscreen" attribute on iframe embeds alongside the legacy allowfullscreen boolean attribute. The allow attribute value is restricted to just "fullscreen" per ADT recommendation, stripping any other directives. This fixes fullscreen for embeds (e.g. Vimeo) that have switched to the new syntax.

Testing Instructions

  1. In a work or other field that allows media embeds, paste a Vimeo (or similar) iframe embed that uses allow="fullscreen" instead of allowfullscreen.
  2. Verify fullscreen works on the embedded player.
  3. Verify an iframe with allow="fullscreen; autoplay" is sanitized down to allow="fullscreen" only.
  4. Verify an iframe with allow="autoplay" (no fullscreen) has the allow attribute stripped entirely.
  5. Verify old embeds using the legacy allowfullscreen attribute still work.

Credit

varram (he/him)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant