Skip to content

Commit

Permalink
fix: 修复子应用媒体元素资源路径错误的问题 (#439)
Browse files Browse the repository at this point in the history
Co-authored-by: space <nageguanzi@gmail.com>
  • Loading branch information
nageguanzi and space authored Mar 14, 2023
1 parent 677f363 commit 68f85a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/wujie-core/src/iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/wujie-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ export function fixElementCtrSrcOrHref(
| typeof HTMLAnchorElement
| typeof HTMLSourceElement
| typeof HTMLLinkElement
| typeof HTMLScriptElement,
| typeof HTMLScriptElement
| typeof HTMLMediaElement,
attr
): void {
// patch setAttribute
Expand Down

0 comments on commit 68f85a8

Please sign in to comment.