Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR allows
amp-subscriptions
to prerender pages in cases where the entitlements can safely be obtained without leaking privacy.Adds a new
isPrerenderSafe()
method to theSubscriptionPlatform
class.If
isPrerenderSafe()
is true thengetEntitlements()
is allowed to progress even if the page is in prerender mode.There are currently two platforms that are prerender safe.
ViewerSubscriptionPlatform
this platform is by definition prerender safe in that the viewer already knows what page is loaded so asking it for an entitlement does not leak additional information to the publisher or a third party.GoogleSubscriptionsPlatformService
is pre-render safe when running under the Google viewer. In that instance google already knows which page was loaded so again asking for entitlements does not present a privacy leak. However on non-google platforms prerender is disabled to prevent a privacy leak.