nex3 / post_message_test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

To test this, run pub serve, visit http://localhost:8080 and open the console:

Console error

The relevant code is in web/index.dart:

window.onMessage.listen((message) {
  window.console.log(message);
  window.console.log(message.source.location);

  // Getting the href from the source location fails.
  try {
    print("Location href: ${message.source.location.href}");
  } catch (error, stackTrace) {
    window.console.error("Error getting href: $error\n$stackTrace");
  }
});

About


Languages

Language:Dart 73.9%Language:HTML 26.1%