From d72028ce7863b12b20fcc0d74c69ae41f8bcbf4c Mon Sep 17 00:00:00 2001 From: rift <117926989+Riftriot@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:30:49 -0600 Subject: [PATCH] Fix name UV config is not defined --- augment.d.ts | 3 --- src/ProxyFrame.tsx | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 augment.d.ts diff --git a/augment.d.ts b/augment.d.ts deleted file mode 100644 index 6c9e3c3..0000000 --- a/augment.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare global { - var __uv$config: any; -} diff --git a/src/ProxyFrame.tsx b/src/ProxyFrame.tsx index e60062f..42a863f 100644 --- a/src/ProxyFrame.tsx +++ b/src/ProxyFrame.tsx @@ -2,6 +2,12 @@ import { RammerheadEncode } from "./RammerheadEncode"; import { useEffect, useState } from "preact/hooks"; +declare global { + interface Window { + __uv$config: any; + } +} + export function ProxyFrame(props: { url: string }) { // pass the URL encoded with encodeURIcomponent var localProxy = localStorage.getItem("proxy") || "automatic"; @@ -18,7 +24,7 @@ export function ProxyFrame(props: { url: string }) { }); } else if (localProxy === "ultraviolet") { window.location.href = - __uv$config.prefix + __uv$config.encodeUrl(decodedUrl); + window.__uv$config.prefix + window.__uv$config.encodeUrl(decodedUrl); } }, [localProxy]);