mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 13:30:00 -04:00
Add ultraviolet
This commit is contained in:
parent
ae499f760c
commit
5270ad40ab
3 changed files with 12 additions and 4 deletions
|
@ -1,18 +1,24 @@
|
|||
// @ts-ignore
|
||||
import { RammerheadEncode } from "./RammerheadEncode";
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
|
||||
export function ProxyFrame(props: { url: string }) { // pass the URL encoded with encodeURIcomponent
|
||||
export function ProxyFrame(props: { url: string }) {
|
||||
// pass the URL encoded with encodeURIcomponent
|
||||
var localProxy = localStorage.getItem("proxy") || "automatic";
|
||||
var [ProxiedUrl, setProxiedUrl] = useState<string | undefined>(undefined);
|
||||
|
||||
var decodedUrl = decodeURIComponent(props.url);
|
||||
|
||||
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
|
||||
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") {
|
||||
RammerheadEncode(decodedUrl).then((result: string) => {
|
||||
setProxiedUrl(result);
|
||||
window.location.href = result;
|
||||
});
|
||||
} else if (localProxy === "ultraviolet") {
|
||||
window.location.href =
|
||||
__uv$config.prefix + __uv$config.encodeUrl(decodedUrl);
|
||||
}
|
||||
}, [localProxy]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue