next-drupal: Preview mode is undefined when called inside of an iframe

Hello !

For context, I am updating an existing website on Next to use next-drupal, and I want to add the preview mode to it. When navigating to the preview URL manually, the preview variable in context is correctly defined to true, but when provided by the Drupal module iframe, the value is always undefined.

I also have problems with the cookies (I made a GDPR compliant cookies manager), since it’s in an iframe, the GDPR pop-up keeps opening on the preview mode, so it’s kind of annoying, I decided to use the preview variable to conditionally disable it when previewing the page, thus my previous problem.

In my Next config file I’ve have some changes done like X-Frame-Options completely emptied out to allow the backend to communicate with my localhost in development and some HSTS headers to make it compliant with some security protocols our clients have.

Thanks in advance,

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16

Most upvoted comments

Upgrading to the rc1 fixed the issue ! Thanks a lot !