Skip to content

Commit e9fefad

Browse files
author
Loïc Mangeonjean
committed
fix: do not force replace extension host worker url
1 parent 57005b3 commit e9fefad

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/service-override/extensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export default function getServiceOverride(
314314
workerConfig != null
315315
? {
316316
...workerConfig,
317-
url: changeUrlDomain(workerConfig.url, iframeAlternateDomain ?? globalThis.location?.href ?? import.meta.url)
317+
url: changeUrlDomain(new URL(workerConfig.url, globalThis.location?.href ?? import.meta.url), iframeAlternateDomain)
318318
}
319319
: undefined
320320

src/service-override/tools/url.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export function changeUrlDomain(url: string, domain?: string): string {
1+
export function changeUrlDomain(url: string | URL, domain?: string): string {
22
if (domain == null) {
3-
return url
3+
return url.toString()
44
}
55
const _url = new URL(url, domain)
66
_url.host = new URL(domain).hostname

0 commit comments

Comments
 (0)