Skip to content

Commit

Permalink
Fix preload warning for invalid as attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhatib committed Mar 8, 2016
1 parent 326d8d7 commit 61dce50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/3p-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test-3p-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 61dce50

Please sign in to comment.