From d056d4db9ede919c30cbbc95a23f458498b13a9c Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Wed, 6 Mar 2024 18:09:41 +0100 Subject: [PATCH] prevent webview url change --- Website/src/components/ModConfView/libs.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Website/src/components/ModConfView/libs.ts b/Website/src/components/ModConfView/libs.ts index d20341db..56e6609f 100644 --- a/Website/src/components/ModConfView/libs.ts +++ b/Website/src/components/ModConfView/libs.ts @@ -21,11 +21,23 @@ import { useConfirm } from "material-ui-confirm"; import { Markup } from "@Components/Markdown"; import { DialogEditTextListItem } from "@Components/DialogEditTextListItem"; import { SearchActivity } from "@Activitys/SearchActivity"; +import React from "react"; export const libraries = [ { name: "react", - __esModule: require("react"), + __esModule: { + ...require("react"), + createElement(type: any, props: any, ...children: any[]) { + switch (type) { + // prevents webview url change + case "a": + return React.createElement(Anchor, props, ...children); + default: + return React.createElement(type, props, ...children); + } + }, + }, }, { name: "@mui/material",