<script>
  var container = document.querySelector("#container");
  const policy_dict = {
    createScript: s => (s.includes("fail") ? null : s.replace("default", "count")),
    createHTML: s => s.replace(/2/g, "3"),
  };

  const policy = trustedTypes.createPolicy("policy", policy_dict);

  let seenSinks;
  function clearSeenSinks() { seenSinks = []; }
  clearSeenSinks();
  const policy_dict_default = {
    createScript: (s, _, sink) => {
      seenSinks.push(sink);
      return (s.includes("fail") ? null :