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

Variable named parent breaks IE11 compat #24

Open cpell opened 5 years ago

cpell commented 5 years ago

When using var parent = window.seamless.connect(); (as a globally scoped variable) to connect the child to parent, it breaks IE11 compatibility because window.parent is needed to send messages to the parent. This essentially overwrites the window.parent reference and causes the frame to fail loading without any exception. I have not seen this issue in other browsers but I imagine it would apply to all IE versions.

In my case, I was able to resolve the issue by renaming parent to top. Since all of the docs and examples use parent as the variable name, it might be good if the docs were updated to use a different name.