@arcmantle/adapter-element
    Preparing search index...

    Type Alias SanitizerFactory

    SanitizerFactory: (
        node: Node,
        name: string,
        type: "property" | "attribute",
    ) => ValueSanitizer

    Used to sanitize any value before it is written into the DOM. This can be used to implement a security policy of allowed and disallowed values in order to prevent XSS attacks.

    One way of using this callback would be to check attributes and properties against a list of high risk fields, and require that values written to such fields be instances of a class which is safe by construction. Closure's Safe HTML Types is one implementation of this technique ( https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md). The TrustedTypes polyfill in API-only mode could also be used as a basis for this technique (https://github.com/WICG/trusted-types).

    Type declaration

      • (node: Node, name: string, type: "property" | "attribute"): ValueSanitizer
      • Parameters

        • node: Node

          The HTML node (usually either a #text node or an Element) that is being written to. Note that this is just an exemplar node, the write may take place against another instance of the same class of node.

        • name: string

          The name of an attribute or property (for example, 'href').

        • type: "property" | "attribute"

          Indicates whether the write that's about to be performed will be to a property or a node.

        Returns ValueSanitizer

        A function that will sanitize this class of writes.