Skip to content

Commit

Permalink
add prefetch method (#4062)
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinmombay committed Jul 14, 2016
1 parent af63a88 commit 979cb6b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build-system/tasks/presubmit-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ var forbiddenTerms = {
'dist.3p/current/integration.js'
]
},
'\\.prefetch\\(': {
message: 'Do not use preconnect.prefetch, use preconnect.preload instead.'
},
'iframePing': {
message: 'This is only available in vendor config for ' +
'temporary workarounds.',
Expand Down
12 changes: 12 additions & 0 deletions src/preconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ export class Preconnect {
this.preconnectPolyfill_(origin);
}

/**
* Temporary to not break prod when versions are misaligned across binaries.
* DO NOT USE!
* This should be safe to remove 1 version after 1468017284333 hits prod.
* @param {string} url
* @param {string=} opt_preloadAs
* @deprecated
*/
prefetch(url, opt_preloadAs) {
this.preload(url, opt_preloadAs);
}

/**
* Asks the browser to preload a URL. Always also does a preconnect
* because browser support for that is better.
Expand Down

0 comments on commit 979cb6b

Please sign in to comment.