{
  "meta": {
    "canonicalUrl": "https://timetostable.com/feature/sanitizer",
    "bcdVersion": "8.1.11",
    "webFeaturesVersion": "3.48.0"
  },
  "kind": "web-feature",
  "webFeature": {
    "id": "sanitizer",
    "name": "Sanitizer API",
    "description": "The Sanitizer API customizes the sanitization of HTML parsed and inserted into the DOM in a way that can prevent cross-site scripting attacks. You can use it with DOM APIs that accept a sanitizer option, such as parseHTML() or setHTML().",
    "group": "other",
    "groupName": "other",
    "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#html-sanitization",
    "baseline": false,
    "compatCount": 14,
    "cats": [
      "api"
    ],
    "compatKeysSample": [
      "api.Document.parseHTML_static",
      "api.Element.setHTML",
      "api.Sanitizer",
      "api.Sanitizer.Sanitizer",
      "api.Sanitizer.allowAttribute",
      "api.Sanitizer.allowElement",
      "api.Sanitizer.get",
      "api.Sanitizer.removeAttribute",
      "api.Sanitizer.removeElement",
      "api.Sanitizer.removeUnsafe",
      "api.Sanitizer.replaceElementWithChildren",
      "api.Sanitizer.setComments",
      "api.Sanitizer.setDataAttributes",
      "api.ShadowRoot.setHTML"
    ],
    "s": {
      "chrome": {
        "v": "146",
        "d": 20522
      },
      "chrome_android": {
        "v": "146",
        "d": 20522
      },
      "edge": {
        "v": "146",
        "d": 20525
      },
      "firefox": {
        "v": "148",
        "d": 20508
      },
      "firefox_android": {
        "v": "148",
        "d": 20508
      }
    }
  },
  "relatedBcdFeatures": [
    {
      "id": "api.Document.parseHTML_static",
      "cat": "api",
      "mdn": "API/Document/parseHTML_static",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtml",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      },
      "notes": [
        {
          "t": "Before version 152, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "chrome",
            "edge",
            "chrome_android",
            "webview_android"
          ]
        },
        {
          "t": "The <code>&lt;base&gt;</code> element is not removed from a configuration's allowlist, potentially allowing manipulation of a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "firefox",
            "firefox_android"
          ]
        },
        {
          "t": "Before version 159, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "firefox",
            "firefox_android"
          ]
        },
        {
          "t": "Before version 136, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "opera"
          ]
        },
        {
          "t": "Before version 102, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "opera_android"
          ]
        }
      ]
    },
    {
      "id": "api.Element.setHTML",
      "cat": "api",
      "mdn": "API/Element/setHTML",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-element-sethtml",
      "st": 1,
      "wf": "html-setters",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      },
      "notes": [
        {
          "t": "Chrome 105 to Chrome 118 (inclusive) supported this method with a significantly different specification.",
          "b": [
            "chrome"
          ]
        },
        {
          "t": "Before version 153, the <code>&lt;base&gt;</code> element was not removed from a configuration's allowlist, which could manipulate a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "chrome",
            "edge",
            "chrome_android",
            "webview_android"
          ]
        },
        {
          "t": "Before version 152, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "chrome",
            "edge",
            "chrome_android",
            "webview_android"
          ]
        },
        {
          "t": "The <code>&lt;base&gt;</code> element is not removed from a configuration's allowlist, potentially allowing manipulation of a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "firefox",
            "firefox_android"
          ]
        },
        {
          "t": "Before version 159, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "firefox",
            "firefox_android"
          ]
        },
        {
          "t": "Edge 105 to Edge 118 (inclusive) supported this method with a significantly different specification.",
          "b": [
            "edge"
          ]
        },
        {
          "t": "Chrome Android 105 to Chrome Android 118 (inclusive) supported this method with a significantly different specification.",
          "b": [
            "chrome_android"
          ]
        },
        {
          "t": "WebView Android 105 to WebView Android 118 (inclusive) supported this method with a significantly different specification.",
          "b": [
            "webview_android"
          ]
        },
        {
          "t": "Samsung Browser 20.0 to Samsung Browser 25.0 (inclusive) supported this method with a significantly different specification.",
          "b": [
            "samsunginternet_android"
          ]
        },
        {
          "t": "Opera 91 to Opera 104 (inclusive) supported this method with a significantly different specification.",
          "b": [
            "opera"
          ]
        },
        {
          "t": "Before version 137, the <code>&lt;base&gt;</code> element was not removed from a configuration's allowlist, which could manipulate a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "opera"
          ]
        },
        {
          "t": "Before version 136, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "opera"
          ]
        },
        {
          "t": "Opera Android 72 to Opera Android 79 (inclusive) supported this method with a significantly different specification.",
          "b": [
            "opera_android"
          ]
        },
        {
          "t": "Before version 103, the <code>&lt;base&gt;</code> element was not removed from a configuration's allowlist, which could manipulate a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "opera_android"
          ]
        },
        {
          "t": "Before version 102, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "opera_android"
          ]
        }
      ]
    },
    {
      "id": "api.Sanitizer",
      "cat": "api",
      "mdn": "API/Sanitizer",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#sanitizer",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      },
      "notes": [
        {
          "t": "Chrome 105 to Chrome 118 (inclusive) supported this interface name with a significantly different specification.",
          "b": [
            "chrome"
          ]
        },
        {
          "t": "Edge 105 to Edge 118 (inclusive) supported this interface name with a significantly different specification.",
          "b": [
            "edge"
          ]
        },
        {
          "t": "Chrome Android 105 to Chrome Android 118 (inclusive) supported this interface name with a significantly different specification.",
          "b": [
            "chrome_android"
          ]
        },
        {
          "t": "WebView Android 105 to WebView Android 118 (inclusive) supported this interface name with a significantly different specification.",
          "b": [
            "webview_android"
          ]
        },
        {
          "t": "Samsung Browser 20.0 to Samsung Browser 25.0 (inclusive) supported this interface name with a significantly different specification.",
          "b": [
            "samsunginternet_android"
          ]
        },
        {
          "t": "Opera 91 to Opera 104 (inclusive) supported this interface name with a significantly different specification.",
          "b": [
            "opera"
          ]
        },
        {
          "t": "Opera Android 72 to Opera Android 79 (inclusive) supported this interface name with a significantly different specification.",
          "b": [
            "opera_android"
          ]
        }
      ]
    },
    {
      "id": "api.Sanitizer.Sanitizer",
      "cat": "api",
      "mdn": "API/Sanitizer/Sanitizer",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-constructor",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.allowAttribute",
      "cat": "api",
      "mdn": "API/Sanitizer/allowAttribute",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-allowattribute",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.allowElement",
      "cat": "api",
      "mdn": "API/Sanitizer/allowElement",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-allowelement",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.get",
      "cat": "api",
      "mdn": "API/Sanitizer/get",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-get",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.removeAttribute",
      "cat": "api",
      "mdn": "API/Sanitizer/removeAttribute",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-removeattribute",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.removeElement",
      "cat": "api",
      "mdn": "API/Sanitizer/removeElement",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-removeelement",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.removeUnsafe",
      "cat": "api",
      "mdn": "API/Sanitizer/removeUnsafe",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-removeunsafe",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      },
      "notes": [
        {
          "t": "Before version 153, the <code>&lt;base&gt;</code> element was not removed from a configuration's allowlist, which could manipulate a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "chrome",
            "edge",
            "chrome_android",
            "webview_android"
          ]
        },
        {
          "t": "The <code>&lt;base&gt;</code> element is not removed from a configuration's allowlist, potentially allowing manipulation of a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "firefox",
            "firefox_android"
          ]
        },
        {
          "t": "Before version 137, the <code>&lt;base&gt;</code> element was not removed from a configuration's allowlist, which could manipulate a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "opera"
          ]
        },
        {
          "t": "Before version 103, the <code>&lt;base&gt;</code> element was not removed from a configuration's allowlist, which could manipulate a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "opera_android"
          ]
        }
      ]
    },
    {
      "id": "api.Sanitizer.replaceElementWithChildren",
      "cat": "api",
      "mdn": "API/Sanitizer/replaceElementWithChildren",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-replaceelementwithchildren",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.setComments",
      "cat": "api",
      "mdn": "API/Sanitizer/setComments",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-setcomments",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.Sanitizer.setDataAttributes",
      "cat": "api",
      "mdn": "API/Sanitizer/setDataAttributes",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-setdataattributes",
      "st": 1,
      "wf": "sanitizer",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      }
    },
    {
      "id": "api.ShadowRoot.setHTML",
      "cat": "api",
      "mdn": "API/ShadowRoot/setHTML",
      "spec": "https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-shadowroot-sethtml",
      "st": 1,
      "wf": "html-setters",
      "bl": false,
      "s": {
        "chrome": {
          "v": "146",
          "d": 20522
        },
        "firefox": {
          "v": "148",
          "d": 20508
        },
        "edge": {
          "v": "146",
          "d": 20525
        },
        "chrome_android": {
          "v": "146",
          "d": 20522
        },
        "firefox_android": {
          "v": "148",
          "d": 20508
        },
        "webview_android": {
          "v": "146",
          "d": 20522
        },
        "samsunginternet_android": {
          "v": "31.0",
          "d": 20719
        },
        "opera": {
          "v": "130",
          "d": 20551
        },
        "opera_android": {
          "v": "97",
          "d": 20559
        }
      },
      "notes": [
        {
          "t": "Before version 152, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "chrome",
            "edge",
            "chrome_android",
            "webview_android"
          ]
        },
        {
          "t": "The <code>&lt;base&gt;</code> element is not removed from a configuration's allowlist, potentially allowing manipulation of a document's relative URLs. See <a href=\"https://github.com/whatwg/html/pull/12664\">whatwg/html#12664</a>.",
          "b": [
            "firefox",
            "firefox_android"
          ]
        },
        {
          "t": "Before version 159, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "firefox",
            "firefox_android"
          ]
        },
        {
          "t": "Before version 136, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "opera"
          ]
        },
        {
          "t": "Before version 102, HTML is sanitized after parsing instead of during parsing. For example, text on either side of a removed element isn't merged into a single text node. See <a href=\"https://github.com/whatwg/html/pull/12756\">whatwg/html#12756</a>.",
          "b": [
            "opera_android"
          ]
        }
      ]
    }
  ]
}