From 31742c3d4d5cd830858c6e368595b5e25c6115a7 Mon Sep 17 00:00:00 2001 From: cyfung1031 <44498510+cyfung1031@users.noreply.github.com> Date: Thu, 1 Jan 2026 01:48:14 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20`GM=5FaddElement("tagName"?= =?UTF-8?q?)`=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/service/content/gm_api/gm_api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/service/content/gm_api/gm_api.ts b/src/app/service/content/gm_api/gm_api.ts index d9d783778..aa109b38e 100644 --- a/src/app/service/content/gm_api/gm_api.ts +++ b/src/app/service/content/gm_api/gm_api.ts @@ -703,7 +703,7 @@ export default class GMApi extends GM_Base { parentNodeId = id; } else { parentNodeId = null; - attrs = tagName as Record; + attrs = (tagName || {}) as Record; tagName = parentNode as string; } if (typeof tagName !== "string") throw new Error("The parameter 'tagName' of GM_addElement shall be a string.");