Skip to content

Commit 62c847f

Browse files
author
姚凱鵬
committed
fix(toolbox): Fixes the window type check issue in SaveAsImage.
1 parent cca9991 commit 62c847f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/component/toolbox/feature/SaveAsImage.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ export interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption {
4242
lang?: string[]
4343
}
4444

45+
interface ProxyWindow extends Window {
46+
rawWindow?: Window
47+
}
48+
4549
function pickEventView(): Window {
4650
try {
47-
void new MouseEvent("click", { view: window?.rawWindow || window });
48-
return window?.rawWindow || window;
51+
void new MouseEvent("click", { view: (window as ProxyWindow)?.rawWindow || window });
52+
return (window as ProxyWindow)?.rawWindow || window;
4953
} catch {
5054
if (document.defaultView) {
5155
try {

0 commit comments

Comments
 (0)