Skip to content

Exact behavior for navigating iframes #578

@simon-friedberger

Description

@simon-friedberger

I've created a new WPT to discuss some details regarding iframes: https://wpt.fyi/results/fullscreen/api/navigate-iframe.sub.html?label=master&label=experimental&aligned

Specifically, Firefox does not allow a cross-origin iframe to navigate itself to be same-origin and obtain permissions that way. Other browsers do.

My interpretation of the spec is that Firefox is correct here because of the following:

According to the spec the default origin for an iframe is its declared origin

meaning, the src attribute...

https://w3c.github.io/webappsec-permissions-policy/#declared-origin

The default allowlist for 'fullscreen' is "'self'"

https://fullscreen.spec.whatwg.org/#permissions-policy-integration

'self':

The feature is allowed in documents in top-level traversables by default,
as well as those in child navigables whose document is same origin with
its parent’s document, when allowed in that Document. It is disallowed
by default in child navigables whose document is cross-origin with its
parent’s document.

https://w3c.github.io/webappsec-permissions-policy/#default-allowlists

Therefore a navigated iframe must not have fullscreen permissions unless the new origin matches the origin in the src attribute and is same-origin with the embedding page.

I'm not sure if I am missing something but it does seem like this might not have been the intended behavior and I would appreciate some clarification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions