subscriptions-project / swg-js

Apache License 2.0
80 stars 106 forks source link

Trusted Types support in swg-js #2746

Open hartmannr76 opened 1 year ago

hartmannr76 commented 1 year ago

When running any of the swg.js binaries with Trusted Types enabled on a page, this breaks. There are a handful of places where we set DOM values using sink API's that are blocked with this mode enabled which may prevent other services using this.

To resolve, we should follow the steps in understanding what lines are using invalid methods, and import a library like SafeValues to allow this to use trusted types before assignment.

More details about this can also be seen in the amphtml repo issue

ChrisAntaki commented 1 year ago

Perhaps we could render HTML with Preact?