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

✨ Ads RTC: support amp-script fetching #33872

Merged
merged 4 commits into from
Apr 21, 2021
Merged

Conversation

samouri
Copy link
Member

@samouri samouri commented Apr 16, 2021

summary
Fixes #33581.

@samouri samouri changed the title ✨ Ads RTC: support amp-script fetching. ✨ Ads RTC: support amp-script fetching Apr 16, 2021
@samouri samouri self-assigned this Apr 16, 2021
@samouri samouri requested a review from calebcordry April 16, 2021 15:56
@calebcordry calebcordry requested a review from powerivq April 16, 2021 18:39
@lgtm-com
Copy link

lgtm-com bot commented Apr 19, 2021

This pull request introduces 1 alert when merging 78bd4f7 into d5de7fc - view on LGTM.com

new alerts:

  • 1 for Comparison between inconvertible types

@samouri samouri force-pushed the adscript branch 4 times, most recently from d8932bc to 8d84f48 Compare April 19, 2021 22:07
@ampproject ampproject deleted a comment from lgtm-com bot Apr 19, 2021
@samouri samouri marked this pull request as ready for review April 20, 2021 14:39
Copy link
Member

@calebcordry calebcordry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on!

rtcFetch = Services.scriptForDocOrNull(element)
.then((service) => {
userAssert(service, 'AMP-SCRIPT is not installed.');
return service.fetch(url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably me not understanding how amp script works, but how to we ensure they are using the no-dom attr?

Copy link
Member Author

@samouri samouri Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a security/ux standpoint, I don't think we actually need it to be nodom.
I.e. some pubs may want to have their amp-script perform both functions:

  1. As a normal amp-script
  2. As something that exports a fn for RTC

All the usual amp-script restrictions apply (no dom mutation without user activity, etc)

Copy link
Member Author

@samouri samouri Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to followup on this to see if sandboxed should imply nodom

@samouri samouri merged commit 4f979ae into ampproject:main Apr 21, 2021
@samouri samouri deleted the adscript branch April 21, 2021 22:47
rochapablo pushed a commit to rochapablo/amphtml that referenced this pull request Aug 30, 2021
* Ads RTC: support amp-script fetching.

* flesh out example better.

* revert unecessary diff

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

Successfully merging this pull request may close these issues.

I2I: Extend amp-ads to support waiting for audience targeting data from an <amp-script>
3 participants