From 9a294a5fab7d18f9b06122e2465ebca063926b37 Mon Sep 17 00:00:00 2001 From: BoBoooooo <17746714@qq.com> Date: Tue, 9 Jul 2024 18:33:47 +0800 Subject: [PATCH] fix: external js add crossorigin attribute --- packages/app/src/sandbox/external-resources.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/app/src/sandbox/external-resources.ts b/packages/app/src/sandbox/external-resources.ts index 8819cc27e9f..3d016165edb 100644 --- a/packages/app/src/sandbox/external-resources.ts +++ b/packages/app/src/sandbox/external-resources.ts @@ -43,6 +43,8 @@ export function createExternalJSLink(resource): HTMLScriptElement { script.setAttribute('src', resource); script.async = false; script.setAttribute('id', 'external-js'); + // allow catch script error + script.setAttribute('crossorigin', 'anonymous'); return script; }