-
Notifications
You must be signed in to change notification settings - Fork 56
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
Option to skip iframe validation? #60
Comments
Hey @markerikson, thanks for logging the issue. Will you try (or have you tried) setting |
Hmm. Here's what I was trying in the process of getting stuff to work earlier today:
So, I never technically tried Any further thoughts? |
modifyObstructiveCode is true by default. Try setting it to false and let me know how it goes please.
|
Huh. Clearly I misread that docs page :) It does indeed say it defaults to Yeah, I just tried uncommenting those lines in Might still be useful to have this as an option anyway, I guess, but doesn't appear to be necessary to solve this use case now. Thanks for helping clear that up! Feel free to close this if you don't plan to make the change. |
I'm going to update the readme with some of these details, then probably create a new ticket to just remove the check entirely in the next major version since it probably doesn't provide a lot of value anyway. |
I've removed the check from Penpal. This change was released in v6. Thanks! |
I'm using Penpal in an app, and I'm trying to test that app via Cypress ( https://www.cypress.io/ ).
Unfortunately, Cypress is finicky about dealing with iframes. Part of that is that it appears to modify the value of
window.top
in order to host your app in its test environment, or something along those lines.Penpal is currently doing an iframe validation check:
penpal/src/child/validateWindowIsIframe.ts
Line 5 in 26f493d
which is being called unconditionally:
penpal/src/child/connectToParent.ts
Line 59 in 26f493d
It seems like Cypress's
experimentalSourceRewriting
option successfully modifies Penpal enough to let the test continue, but that rewriting process takes a very long time to run as the test starts.I can confirm that if I hand-edit the contents of
node_modules/penpal
to comment out thevalidateIframe()
check, that my app loads okay in Cypress.Would it be possible to get an option added to
connectToParent()
to allow skipping that check? It looks like all that's needed is adding a boolean to theOptions
type and then moving the validate check into anif
statement.The text was updated successfully, but these errors were encountered: