diff --git a/packages/wujie-core/src/iframe.ts b/packages/wujie-core/src/iframe.ts index a0f58722b..931db9a85 100644 --- a/packages/wujie-core/src/iframe.ts +++ b/packages/wujie-core/src/iframe.ts @@ -77,6 +77,8 @@ declare global { HTMLLinkElement: typeof HTMLLinkElement; // script type HTMLScriptElement: typeof HTMLScriptElement; + // media type + HTMLMediaElement: typeof HTMLMediaElement; EventTarget: typeof EventTarget; Event: typeof Event; ShadowRoot: typeof ShadowRoot; @@ -576,6 +578,7 @@ function patchRelativeUrlEffect(iframeWindow: Window): void { fixElementCtrSrcOrHref(iframeWindow, iframeWindow.HTMLSourceElement, "src"); fixElementCtrSrcOrHref(iframeWindow, iframeWindow.HTMLLinkElement, "href"); fixElementCtrSrcOrHref(iframeWindow, iframeWindow.HTMLScriptElement, "src"); + fixElementCtrSrcOrHref(iframeWindow, iframeWindow.HTMLMediaElement, "src"); } /** diff --git a/packages/wujie-core/src/utils.ts b/packages/wujie-core/src/utils.ts index 441c9b5bf..0bc001adb 100644 --- a/packages/wujie-core/src/utils.ts +++ b/packages/wujie-core/src/utils.ts @@ -165,7 +165,8 @@ export function fixElementCtrSrcOrHref( | typeof HTMLAnchorElement | typeof HTMLSourceElement | typeof HTMLLinkElement - | typeof HTMLScriptElement, + | typeof HTMLScriptElement + | typeof HTMLMediaElement, attr ): void { // patch setAttribute