From c28d823d7c89787390866cbfefb52e4615e084cb Mon Sep 17 00:00:00 2001 From: rift <117926989+Riftriot@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:53:46 -0600 Subject: [PATCH] Submission validation --- src/ProxyFrame.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ProxyFrame.tsx b/src/ProxyFrame.tsx index 42a863f..372d433 100644 --- a/src/ProxyFrame.tsx +++ b/src/ProxyFrame.tsx @@ -1,4 +1,3 @@ -// @ts-ignore import { RammerheadEncode } from "./RammerheadEncode"; import { useEffect, useState } from "preact/hooks"; @@ -15,6 +14,13 @@ export function ProxyFrame(props: { url: string }) { var decodedUrl = decodeURIComponent(props.url); + if (!decodedUrl.includes(".")) { + decodedUrl = "https://www.google.com/search?q=" + decodedUrl; // If the users input has no . then we change it to a google query. TODO: Feature to change search engines + } + if (decodedUrl.startsWith("http://") || !decodedUrl.startsWith("https://")) { + decodedUrl = "https://" + decodedUrl; + } + useEffect(() => { // For now we can redirect to the results. In the future we will add an if statement looking for the users proxy display choice if (localProxy === "rammerhead") {