Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is postmessage, and what do I need it for? #17

Open
ghost opened this issue Apr 18, 2017 · 2 comments
Open

What is postmessage, and what do I need it for? #17

ghost opened this issue Apr 18, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2017

When using either the parent or child version of seamless.js I get the following message in the console: You must install the postmessage.js module to use seamless.js. I did not find a mention of postmessage in the install instructions.

I tried using seamless.child.nopm.js because I assumed that "nopm" would mean "no postmessage", but the result is the same.

I am using Seamless 1.2.0.

@raochoar
Copy link

raochoar commented Jan 8, 2018

Any thought ?

@rohanrp
Copy link

rohanrp commented Aug 3, 2020

There is a weird bug where seamless initialises postmessage under the 'pm' property of the window object. But in some cases where seamless is called directly by another script, the window object is not passed in. It kind of expects seamless to be called by the html document so that the script runs under the window context i.e. this = window

if you are using webpack try

const seamless = require('!raw-loader!seamless/build/seamless.parent.min.js');
eval.call(null, seamless.default);

or via a promise

import('!raw-loader!../../../node_modules/seamless/build/seamless.parent.min.js').then(rawModule => {
eval.call(null, rawModule.default);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants