-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Use 3p path instead of fast fetch if site is on HTTP #7038
Comments
Isn't this going to be a mixed content issue and blocked by the browser? |
For AdSense and DoubleClick, this is automatically handled by isGoogleAdsA4AValidEnvironment (in amphtml/ads/google/a4a/utils.js), where we check the browser for supportsNativeCrypto. Probably this should be part of AmpAd's upgradeCallback instead, since the crypto requirement is an AMP dependency, not a decision made by each individual ad network. (Also, should this call isCryptoAvailable from crypto-verifier.js, rather than have the logic in a second place?) I would expect that if crypto is unavailable at a4a response handling time, then we treat it the same as an unsigned response, and fall back to cross-domain iframe rendering, but I haven't verified that behavior. |
@michaelkleber is correct; browsers without Web Crypto can use Fast Fetch if the ad network permits it (AdSense and DoubleClick currently don't), but the creative will be rendered using delayed rendering regardless of its signature status. @dknecht, unless my knowledge of browser security policies is rusty, HTTP pages can make AJAX requests to HTTPS URLs just fine (and all A4A Fast Fetch ad networks use HTTPS); only the reverse situation would result in a mixed content problem. @jasti, what exactly is problematic about the current behavior? |
Makes sense. I was thinking more of amp only context where pages were https only. |
AMP isn't HTTPS-only; AMP Caches are (or at least should be), but A4A Fast Fetch works fine on AMP pages served directly from the publisher domain if the ad network permits it (again, AdSense and DoubleClick currently do not, though it seems TripleLift does). That said, we don't intend to allow ad networks to serve Fast Fetch ads over insecure HTTP (a network impl that built non-HTTPS URLs would be rejected in code review), so there aren't going to be mixed content problems from that end. |
I'm closing this issue because the ad network could simply take advantage of fast fetch on non-HTTPS pages even though the ads themselves might render into cross domain iframe. |
This isn't currently documented anywhere. The place to put it would be either Brad's implementation guide or the A4A spec for ad networks (which is still in the works). Unless there should be an additional source of A4A documentation apart from those? |
That guide is not public yet, no. I can add this to the guide. I would like to go through it again before it becomes public and make sure that all of the terminology matches the terminology guide now that it is nailed down. |
@bradfrizzell Unless I'm missing it, would you be able to add to this information to https://github.com/ampproject/amphtml/blob/master/ads/google/a4a/docs/Network-Impl-Guide.md |
For an AMP ad to be signed, the host page must be on HTTPS. We should optimize to fallback to 3P path if we recognize that the site is HTTP.
CC @lannka @ampproject/a4a
The text was updated successfully, but these errors were encountered: