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

Allow expanding variables in amp-iframe src URL #38738

Open
0x7f opened this issue Apr 5, 2023 · 1 comment
Open

Allow expanding variables in amp-iframe src URL #38738

0x7f opened this issue Apr 5, 2023 · 1 comment

Comments

@0x7f
Copy link
Contributor

0x7f commented Apr 5, 2023

Description

There are a couple of places where variables like CANONICAL_URL are expanded automatically (form inputs, URL in amp-consent, variables in amp-analytics, etc.). But it is not possible to pass variables to the amp-iframe's src URL. Is there a reason that this is not the case? Or was there just no need for it so far?

I planned to implement it, but faced a few questions:

  • Implement it for amp-iframe v0.1 or v1.0 or both?
  • The AmpIframe.transformSrc_ function (assuming v0.1 is fine) is a perfect place to put the call to Services.urlReplacementsForDoc. But it is sync. Is it okay to use expandUrlSync and miss the async variables for now? Or shall the whole init code of amp-iframe be changed into async so expandUrlAsync could be used?
  • Some variables that should be blacklisted/whitelisted?

Alternatives Considered

I don't really see an alternative for e.g. passing canonical URL to an iframe other than having support for variables.

Additional Context

No response

@erwinmombay
Copy link
Member

i believe there was an actual reason for this, but can't remember. Let me dig up some design docs and get back to you.

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

2 participants