MCPcopy Create free account
hub / github.com/ampproject/amphtml / relativeToSourceUrl

Function relativeToSourceUrl

src/url.js:558–564  ·  view source on GitHub ↗
(relativeUrlString, element)

Source from the content-addressed store, hash-verified

556 * @return {string}
557 */
558export function relativeToSourceUrl(relativeUrlString, element) {
559 const {sourceUrl} = Services.documentInfoForDoc(element);
560 return Services.urlForDoc(element).resolveRelativeUrl(
561 relativeUrlString,
562 sourceUrl
563 );
564}
565
566/**
567 * Fallback for URL resolver when URL class is not available.

Callers

nothing calls this directly

Calls 1

resolveRelativeUrlMethod · 0.80

Tested by

no test coverage detected