1

I know that I can use local storage, cookies and postMessage but all these methods only accept simple types. I want to pass objects and lists directly to the other window.

I found a similar question but using javascript. I'd like to do something just like Victor pointed in the following link.

Can I pass a JavaScript variable to another browser window?

Trying anything similar in Dart gives me a warining even before running.

var popup = window.open('popup.html', ''); popup.variable = localVariable; //warning here

Community
  • 1
  • 1
  • Have you tried serialising the variable to a string (maybe just JSON) first, and then deserializing it in the new window? – ianmjones Mar 15 '14 at 00:29
  • Yes, and that's my first alternative right now. But if possible to pass directly like in that JS code, I'd use it. – Cassio Tavares Mar 15 '14 at 02:05

1 Answers1

1

Passing objects is not possible.

You can serialize to JSON to make it a simple type and pass it using postMessage and then deserialize. Lists and maps containing only simple types should work with postMessage.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567