PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
8.84k stars 314 forks source link

[BUG] CSP Restriction for TrustedTypePolicy Creation in Loading Indicator #998

Closed axelschapmann closed 3 weeks ago

axelschapmann commented 3 weeks ago

What happened?

A bug happened with the policy in dev mode.

I know that there was a fix a couple days ago, but the bug still remains on some website. That is the case on LinkedIn.

The error occurs on the home page / or a profile page, but if you go to a more specific url, like "https://www.linkedin.com/blog/member". There is no more error

Currently, i can load the extension with the prod folder, but it's not optimal as solution.

What wan i do to avoid the bug ?

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

Refused to create a TrustedTypePolicy named 'trusted-html-__plasmo-loading__' because it violates the following Content Security Policy directive: "trusted-types 'allow-duplicates' default jSecure highcharts dompurify". Uncaught TypeError: Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy "trusted-html-__plasmo-loading__" disallowed.

(OPTIONAL) Contribution

Code of Conduct

EtoKruto commented 3 weeks ago

Try this temporary fix: https://github.com/PlasmoHQ/plasmo/issues/985#issuecomment-2164388705 Worked for LinkedIn not sure if other sites will support this

louisgv commented 3 weeks ago

Duplicate of #985