Skip to content

No access to Document from IFrame #20944

Closed
@DartBot

Description

@DartBot

This issue was originally filed by dpidcock...@google.com


I'm trying to access the document element of an iFrame in Chrome.

In Javascript I would try the following :

          (frame.contentDocument || frame.contentWindow.document);

In Dart, the above properties do not exist in the generated Native Wrappers, but can be accessed through JsObject ;

  Element e = new Element.iframe();
  document.body.append(e);
  JsObject enative = new JsObject.fromBrowserObject(e);
  print (enative['contentWindow']['document']);
  print (e.contentWindow.document);

produces:

[object HTMLDocument]
Breaking on exception: Class '_DOMWindowCrossFrame' has no instance getter 'document'.

Same for contentDocument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions