wp-calypso
wp-calypso copied to clipboard
Accessing "New Page" via the Command Pallete While Writing a Post in Calypso Causes "Refused to display (..) 'X-Frame-Options' to 'sameorigin'" error #92634
Quick summary
While working on the Calypso editor, I tried to create a new page but the editor crashed:
https://github.com/user-attachments/assets/33407f03-67c8-4f09-a189-8ca4174cc224
I see this error:
Refused to display 'https://gomezsorianoclara.wordpress.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Interestingly enough, creating a new post works correctly (it redirects to foo.wordpress.com/wp-admin/post-new.php)
Steps to reproduce
- Go to https://wordpress.com/post/
- Go to the command palette and search for "Page"
- Click on "New Page"
What you expected to happen
It should create a new page
What actually happened
It crashed
Impact
All
Available workarounds?
Yes, easy to implement
If the above answer is "Yes...", outline the workaround.
The wp-admin at wp-admin/post-new.php works fine.
Platform (Simple and/or Atomic)
Simple
Logs or notes
This seems directly related to this other bug that was affecting patterns:
- https://github.com/Automattic/wp-calypso/issues/92634
@xavier-lc, I see you fixed the previous related issue. Is this a regression? Could you please take a look? Thank you!
We have fixed a similar error in another screen by using the function openLinksInParentFrame. See https://github.com/Automattic/wp-calypso/issues/83472
@mrfoxtalbot hey, sorry for the late reply, I was AFK last week.
@epeicher are you working on this? If not, I can take over.
@xavier-lc I have created this draft PR as proof of concept for a potential fix for the Add new Page command: https://github.com/Automattic/wp-calypso/pull/94114.
But I think this can be generalized, as it also affects the Add new Post command. I have based the changes in this PR from you, so I am happy if you take over because you probably have more context on this than me, as I'm modifying this code for the first time 😄
We have fixed a similar error in another screen by using the function openLinksInParentFrame. See #83472
Thanks for sharing. I don't think it works in this case, though, because the commands don't have an actual link, they run a callback.
Fixed in https://github.com/Automattic/wp-calypso/pull/94114 Deployed in r303334-wpcom
Waiting for the wpcom-block-editor cache to expire to test the changes in production
After the wpcom-block-editor is deployed and the cache has expired, we can see this is fixed. Here are some videos:
Add new page
https://github.com/user-attachments/assets/377b6185-900c-48c3-8e55-01aea58f907d
Add new post
https://github.com/user-attachments/assets/ee8aedba-1042-4c40-85ab-3cdb7a84dc9a