travist / seamless.js

A Javascript library for working with seamless iframes.
http://www.travistidwell.com/seamless.js
MIT License
217 stars 44 forks source link

Fix postmessage using "this" as window #21

Closed randallknutson closed 5 years ago

randallknutson commented 5 years ago

This also undoes the git submodule and directly copies the source.

The issue here is that postmessage is passing "this" as window which is only sometimes correct. When including the file with webpack or another module bundler, "this" is actually the export object. This results in postmessage not being correctly added to the window object. Seamless cannot then find it.