-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
do not use window.history if inside iframe #3437
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
In this case of inside a frame, Next's history based routing won't work.
So, user should not use Next's routing inside a frame.
Yes we should not throw an error. But we should warn the user in the dev mode.
(use execOnce and warn for this)
* Add a nerv example. * Fix for indentation/style * Fix for name
Hi again! I just now added the warning using execOnce as you suggested. |
Thank you very much @hankmander 🙏 |
Thank you guys for being responsive to requests and maintaining an awesome project! 😄 |
❤️ |
@timneutkens It says above "timneutkens merged commit b8f189f into zeit:canary on 4 Feb” but it seems this is not in Next.js 7.0.2? |
This checks if next.js is run inside an iframe in which case it does not use window.history. I do not see how history makes sense in the context of being embedded in another site anyway.
Fixes this crash that prevented next.js from working at all in an iframe: #3118