MCPcopy
hub / github.com/ampproject/amphtml / url

Method url

src/preconnect.js:118–122  ·  view source on GitHub ↗

* Preconnects to a URL. Always also does a dns-prefetch because * browser support for that is better. * * It is safe to call this method during prerender with any value, * because no action will be performed until the doc is visible. * * It is safe to call this method with non-HTTP

(ampdoc, url, opt_alsoConnecting)

Source from the content-addressed store, hash-verified

116 * will be used very soon.
117 */
118 url(ampdoc, url, opt_alsoConnecting) {
119 ampdoc.whenFirstVisible().then(() => {
120 this.url_(ampdoc, url, opt_alsoConnecting);
121 });
122 }
123
124 /**
125 * Preconnects to a URL. Always also does a dns-prefetch because

Callers 7

preloadMethod · 0.95
newPageFunction · 0.45
navigateToEnvironmentMethod · 0.45
test-preconnect.jsFile · 0.45
upgradeOrSchedule_Method · 0.45
preconnectToOriginFunction · 0.45
preconnectCallbackMethod · 0.45

Calls 3

url_Method · 0.95
thenMethod · 0.45
whenFirstVisibleMethod · 0.45

Tested by

no test coverage detected