You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] 插件JS crash: Failed to execute 'parseFromString' on 'DOMParser': This document requires 'TrustedHTML' assignment. #1239
32eff70a-ec41-43da-bb73-dc22c6861c8c:2 This document requires 'TrustedHTML' assignment. The action has been blocked.
get responseXML @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
shallowcopy_obj @ Image Max URL.user.js:3064
shallowcopy @ Image Max URL.user.js:3079
data.onload @ Image Max URL.user.js:2137
n @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
Z @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
(anonymous) @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
R @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
(anonymous) @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
a.emit @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
messageHandle @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
(anonymous) @ 32eff70a-ec41-43da-bb73-dc22c6861c8c:2
nativeSend @ 4460e46c-3b1c-40bc-8132-95cb9aeb7620:2
postMessage @ 4460e46c-3b1c-40bc-8132-95cb9aeb7620:2
sendMessage @ 4460e46c-3b1c-40bc-8132-95cb9aeb7620:2
(anonymous) @ 4460e46c-3b1c-40bc-8132-95cb9aeb7620:2
Uncaught (in promise) TypeError: Failed to execute 'parseFromString' on 'DOMParser': This document requires 'TrustedHTML' assignment.
at get responseXML (32eff70a-ec41-43da-bb73-dc22c6861c8c:2:19444)
at Object.assign (<anonymous>)
at shallowcopy_obj (Image Max URL.user.js:3064:18)
at shallowcopy (Image Max URL.user.js:3079:12)
at data.onload (Image Max URL.user.js:2137:18)
at n (32eff70a-ec41-43da-bb73-dc22c6861c8c:2:21025)
at Z (32eff70a-ec41-43da-bb73-dc22c6861c8c:2:15701)
at 32eff70a-ec41-43da-bb73-dc22c6861c8c:2:22241
at new Promise (<anonymous>)
at R (32eff70a-ec41-43da-bb73-dc22c6861c8c:2:22089)
Activity
cyfung1031 commentedon Feb 13, 2026
TTP issue
后记:
一般使用者其实也可以用比较简单的方法解决这个问题。只要安装一些专门处理 TTP 的用户脚本就可以了,例如这个脚本:
https://scriptcat.org/zh-CN/script-show-page/5410
cyfung1031 commentedon Feb 13, 2026
先讲结论
跟 Tampermonkey 做法一样。不会在 UserScript Manager 层面处理
fireattack commentedon Feb 13, 2026
不太懂这方面,不过我看你发的那个 issue 写的 fixed?
如果功能处理不了,感觉至少可以 handle 一下 error 让脚本不要 crash?
cyfung1031 commentedon Feb 13, 2026
解决方法有两个
https://greasyfork.org/scripts/522884-default-trusted-types-policy-for-all-pages/
https://greasyfork.org/scripts/522884-default-trusted-types-policy-for-all-pages/code
( 你也可以把这个脚本直接安装它。一步解决)
//@inject-into content. 具体说明: https://violentmonkey.github.io/posts/inject-into-context/cyfung1031 commentedon Feb 13, 2026
里面的讨论很长。标题那个问题确实fixed,但你说的这个还存在
VM那边也是直接关掉Issue的。 ScriptCat也是不会在 UserScript Manager 层面处理
violentmonkey/violentmonkey#1873
也有很多零零碎碎的相关讨论
如果你是使用者,不懂代码,直接安装 https://greasyfork.org/scripts/522884-default-trusted-types-policy-for-all-pages/ 就好
fireattack commentedon Feb 13, 2026
好的谢谢
fireattack commentedon Feb 13, 2026
但是我在楼主说的这个步骤,使用 Chrome + tampermonkey,是可以正常不报错的(没有安装你提供的 "Default Trusted Types Policy for All Pages").
CodFrm commentedon Feb 13, 2026
我试了一下 TM 可以正常运行,我先打开,后面再研究一下
cyfung1031 commentedon Feb 13, 2026
找到问题了。确实在ScriptCat的代码(我写的部份)有别的问题。我会处理
暂时你可以用 Default Trusted Types Policy for All Pages 解决。
我也把脚本上载到 脚本猫的网站了
https://scriptcat.org/zh-CN/script-show-page/5410
cyfung1031 commentedon Feb 14, 2026
@CodFrm @fireattack
简单说明一下
这个 issue 是因为
https://docs.google.com/forms/...)时很不幸这些内部处理不一致会使ScriptCat坏掉那个
This document requires 'TrustedHTML' assignment.的问题,其实在 Tampermonkey 也有,只是没有在 "Image Max URL" 使用时触发出来PR已经提交了。不过作者最近忙又对于复杂的代码表示抗拒。 不清楚什么时候会修好
cyfung1031 commentedon Feb 16, 2026
#1242