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

Function calculateScriptBaseUrl

src/service/extension-script.js:19–32  ·  view source on GitHub ↗
(location, opt_isLocalDev)

Source from the content-addressed store, hash-verified

17 * @return {string}
18 */
19export function calculateScriptBaseUrl(location, opt_isLocalDev) {
20 if (opt_isLocalDev) {
21 let prefix = `${location.protocol}//${location.host}`;
22 if (
23 location.protocol == 'about:' ||
24 location.protocol == 'blob:' ||
25 location.protocol == 'data:'
26 ) {
27 prefix = '';
28 }
29 return `${prefix}/dist`;
30 }
31 return urls.cdn;
32}
33
34/**
35 * Calculate script url for an extension.

Callers 4

getVendorUrl_Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected