From 68f85a8cc7089367db4f0bdfc4620135540dbd92 Mon Sep 17 00:00:00 2001 From: blankSpace <46484344+nageguanzi@users.noreply.github.com> Date: Tue, 14 Mar 2023 15:21:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=90=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=AA=92=E4=BD=93=E5=85=83=E7=B4=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#439)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: space --- packages/wujie-core/src/iframe.ts | 3 +++ packages/wujie-core/src/utils.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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