Skip to content

Should <object data=...> support javascript: URLs? #10719

Open
@mbrodesser-Igalia

Description

@mbrodesser-Igalia

What is the issue with the HTML Standard?

Browsers' behavior differs for it. E.g. for https://jsfiddle.net/6bv9xogk/, Chrome and WebKit treat javascript: URLs as no-ops, Firefox executes the script.

The object element's data attribute is specified 1 as a "valid non-empty URL potentially surrounded by spaces" 2. The iframe element's src attribute 3 has the same type. All major browsers support javascript: URLs in iframes. So per spec, iframe elements and object elements should behave the same.

I couldn't figure out yet whether 2 includes javascript: URLs.

Footnotes

  1. https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-object-data

  2. https://html.spec.whatwg.org/multipage/urls-and-fetching.html#valid-non-empty-url-potentially-surrounded-by-spaces 2

  3. https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-src

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions