Skip to content
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

Google Map with <amp-iframe> #38556

Open
Davidfredette opened this issue Nov 22, 2022 · 1 comment
Open

Google Map with <amp-iframe> #38556

Davidfredette opened this issue Nov 22, 2022 · 1 comment

Comments

@Davidfredette
Copy link

Description

When using amp-iframe to insert a google map and user click on the link to open the map or the streetview to fullscreen into a new tab, the navigator return an error of cross-origin opener policy

Reproduction Steps

See the issue at https://fenetresdrummond.ca/ the map is located at the bottom of the page in the footer.

Relevant Logs

No response

Browser(s) Affected

No response

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

No response

@Jozebel11
Copy link

The site https://fenetresdrummond.ca/ needs control over the domain it is trying to iframe. If google-maps has restricted Cross-Origin requests then there isn't much that can be done.

Otherwise you can try install cors to the https://fenetresdrummond.ca/ package.json and amend the Access-Control-Allow-Origin to allow google maps like this Access-Control-Allow-Origin: 'https://google.com/maps' or allow any site using Access-Control-Allow-Origin: *

Keep in mind cors policies protect you and your site from Cross Site Request Forgery.

I hope this is helpful, please let me know if this works for your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants