Skip to content

Commit b76ac75

Browse files
huangchenbjchenhuang444
authored andcommitted
feat: allow loading file:// protocol microapps
1 parent 0fc093e commit b76ac75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libs/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ export function formatAppURL(url: string | null, appName: string | null = null):
319319
* BUG FIX: Never using '/' to complete url, refer to https://github.com/jd-opensource/micro-app/issues/1147
320320
*/
321321
const fullPath = `${origin}${pathname}${search}`
322+
if (/^file:\/\//.test(fullPath)) {
323+
return fullPath
324+
}
322325
return /^https?:\/\//.test(fullPath) ? fullPath : ''
323326
} catch (e) {
324327
logError(e, appName)

0 commit comments

Comments
 (0)