(location, opt_isLocalDev)
| 17 | * @return {string} |
| 18 | */ |
| 19 | export 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. |
no outgoing calls
no test coverage detected