I think it is also a good idea to update some of the few options for the DOMPurify configuration option to return trusted type by adding the RETURN_TRUSTED_TYPE property set to true when DOMPurify.sanitize() is used:
|
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM: true; }): HTMLElement; |
Reference:
https://github.com/cure53/DOMPurify?tab=readme-ov-file#what-about-dompurify-and-trusted-types
https://web.dev/articles/trusted-types#use_a_library
Originally posted by @martgil in #5575 (review)
flowcrypt-browser/extension/types/purify.d.ts
Line 18 in a403966
Reference:
https://github.com/cure53/DOMPurify?tab=readme-ov-file#what-about-dompurify-and-trusted-types
https://web.dev/articles/trusted-types#use_a_library
Originally posted by @martgil in #5575 (review)