-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
FPC JS - Fix for CORS issue #7914
Conversation
@OZZlE PR is merged, thank you for the contribution! |
You are welcome! :) |
The fix is incomplete as 3rd party iframe URL may contain the site's domain in a query string. For example, Google Customer Reviews badge. Example Magento 2 website: Notice the domain "www.lillianvernon.com" in the iframe URL, but it's not the Magento page. |
@sshymko it would be more productive to report a new issue referring to this PR rather than to comment in a closed ticket. |
Submitted #9090 |
Already fixed #8005 |
Still happened on 2.1.6: |
@winds1983 it's merged to develop and will be released probably as 2.2.0 |
Or someone can backport the PR, so it gets included in 2.1.x: |
I have still this issue |
@Ylmzef On 2.2? |
@Igloczek yes |
@Ylmzef You should open a new issue with a detailed description and steps to reproduce it, b/c code of this and related PR is present in M2.2. |
I'm not sure exactly where to write this. But I'm trying to fix this DOM error and I applied more than one suggestion in this forum. I've applied this one: 9e7f664 Then I tried to apply this other solution described in another document in page-cache.js : // prevent cross origin iframe content reading
It did fix iframe problem but it breaks checkout credit card form. I don't have how to fix credit card form. I know that the payment module uses Vanilla JS. |
@gcampedelli have you tried this one? https://github.com/magento/magento2/pull/8005/files |
@gcampedelli maybe that was the one you were referring to? Might be better to create a new issue instead |
Hello Ozzie, yes, I tried this one as well. https://github.com/magento/magento2/pull/8005/files. `/**
I just got an unexpected token that maybe easy to solve. These are lines that are in red here - 3026e81 |
…29_2022 Arrows Team - Bugfix delivery
Page cache JS cannot modify dom of a external iframed page.
How to test (this is a fix for below):
<iframe src="https://google.com/"></iframe>Insert an iframe into your magento page with an external source for example (assuming you aren't google):
Expected result:
No JS errors in console
Actual result (from chrome):
Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://google.com/" from accessing a cross-origin frame.