Preview mode is undefined when called inside of an iframe
See original GitHub issueHello !
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,
Issue Analytics
- State:
- Created a year ago
- Comments:16
Top GitHub Comments
Upgrading to the rc1 fixed the issue ! Thanks a lot !
@Kroonax Since this bug came up a few times, I backported the fix and created a new release.
Can you upgrade to
next-drupal 1.4-rc1
and test please?Note: I’d still recommend the
DrupalClient
going forward.Thank you.