diff --git a/src/3p-frame.js b/src/3p-frame.js index bfbe613d25b6..9711d26428c8 100644 --- a/src/3p-frame.js +++ b/src/3p-frame.js @@ -156,7 +156,9 @@ export function addDataAndJsonAttributes_(element, attributes) { export function prefetchBootstrap(window) { const url = getBootstrapBaseUrl(window); const preconnect = preconnectFor(window); - preconnect.prefetch(url, 'document'); + // `as=document` attribute is left out on purpose for lack of support and is + // an invalid value that is thrown as a warning message in the logs. + preconnect.prefetch(url); // While the URL may point to a custom domain, this URL will always be // fetched by it. preconnect.prefetch( diff --git a/test/functional/test-3p-frame.js b/test/functional/test-3p-frame.js index 17120e40ddc8..56005e29e759 100644 --- a/test/functional/test-3p-frame.js +++ b/test/functional/test-3p-frame.js @@ -183,7 +183,7 @@ describe('3p-frame', () => { expect(fetches).to.have.length(2); expect(fetches[0].href).to.equal( 'http://ads.localhost:9876/dist.3p/current/frame.max.html'); - expect(fetches[0].getAttribute('as')).to.equal('document'); + expect(fetches[0].getAttribute('as')).to.be.null; expect(fetches[1].href).to.equal( 'https://3p.ampproject.net/$internalRuntimeVersion$/f.js'); expect(fetches[1].getAttribute('as')).to.equal('script');