Quellcode durchsuchen

ref: remove getBrowserType check

Sv443 vor 8 Monaten
Ursprung
Commit
aeeb45fd00
2 geänderte Dateien mit 2 neuen und 7 gelöschten Zeilen
  1. 2 2
      src/utils/dom.ts
  2. 0 5
      src/utils/misc.ts

+ 2 - 2
src/utils/dom.ts

@@ -1,5 +1,5 @@
 import { addGlobalStyle, getUnsafeWindow, randomId, type Stringifiable } from "@sv443-network/userutils";
-import { error, fetchCss, getBrowserType, getDomain, t } from "./index.js";
+import { error, fetchCss, getDomain, t } from "./index.js";
 import { addSelectorListener } from "../observers.js";
 import type { ResourceKey, TTPolicy } from "../types.js";
 import { siteEvents } from "../siteEvents.js";
@@ -241,7 +241,7 @@ export function setInnerHtmlTrusted(element: HTMLElement, html: string) {
     ttPolicy = window.trustedTypes?.createPolicy("default", {
       createHTML: (unsafeHtml) =>
         DOMPurify.sanitize(unsafeHtml, {
-          RETURN_TRUSTED_TYPE: getBrowserType() === "chromium",
+          RETURN_TRUSTED_TYPE: false,
         }),
     });
 

+ 0 - 5
src/utils/misc.ts

@@ -184,11 +184,6 @@ export async function tryToDecompressAndParse<TData = Record<string, unknown>>(i
   return parsed;
 }
 
-/** Returns the browser type as either "firefox" or "chromium" */
-export function getBrowserType(): "firefox" | "chromium" {
-  return navigator.userAgent.match(/firefox/i) ? "firefox" : "chromium";
-}
-
 //#region resources
 
 /**