diff --git a/code/core/src/manager-api/modules/refs.ts b/code/core/src/manager-api/modules/refs.ts index 586453443c05..b27adc7a3abb 100644 --- a/code/core/src/manager-api/modules/refs.ts +++ b/code/core/src/manager-api/modules/refs.ts @@ -81,10 +81,8 @@ export const getSourceType = (source: string, refId?: string) => { const { origin: localOrigin, pathname: localPathname } = location; const { origin: sourceOrigin, pathname: sourcePathname } = new URL(source); - const localFull = `${localOrigin + localPathname}`.replace('/iframe.html', '').replace(/\/$/, ''); - const sourceFull = `${sourceOrigin + sourcePathname}` - .replace('/iframe.html', '') - .replace(/\/$/, ''); + const localFull = `${localOrigin + localPathname}`.replace(/\/[^\/]*$/, ''); + const sourceFull = `${sourceOrigin + sourcePathname}`.replace(/\/[^\/]*$/, ''); if (localFull === sourceFull) { return ['local', sourceFull];