Merge branch 'rewrite' of https://github.com/IncognitoTGT/Nebula into rewrite

This commit is contained in:
incognitotgt 2023-12-27 15:10:09 -05:00
commit 1b2f57e7d0
5 changed files with 36 additions and 30 deletions

View file

@ -4,6 +4,12 @@ import { Link } from "preact-router";
import { RiPictureInPictureExitFill, RiFullscreenFill } from "react-icons/ri";
import { IoCodeSlashSharp } from "react-icons/io5";
import { FaXmark } from "react-icons/fa6";
interface ProxyFrame extends HTMLElement {
contentWindow: any;
contentDocument: any;
}
export function IframeHeader(props: { url: string }) {
const { t } = useTranslation();
const [showPopout, setShowPopout] = useState(false);
@ -38,30 +44,31 @@ export function IframeHeader(props: { url: string }) {
<IoCodeSlashSharp
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
onClick={() => {
const proccy = document.getElementById("iframe");
if (!proccy) return;
// @ts-ignore
const proccyWindow = proccy.contentWindow;
// @ts-ignore
const proccyDocument = proccy.contentDocument;
if (!proccyWindow || !proccyDocument) return;
if (proccyWindow.eruda?._isInit) {
proccyWindow.eruda.destroy();
} else {
let script = proccyDocument.createElement('script');
script.src = "https://cdn.jsdelivr.net/npm/eruda";
script.onload = function() {
if (!proccyWindow) return;
proccyWindow.eruda.init();
proccyWindow.eruda.show();
}
proccyDocument.head.appendChild(script);
}
}
}
/>
const proxyFrame: ProxyFrame | null = document.getElementById(
"iframe"
) as ProxyFrame;
if (!proxyFrame) return;
const proxyWindow = proxyFrame.contentWindow;
const proxyDocument = proxyFrame.contentDocument;
if (!proxyWindow || !proxyDocument) return;
if (proxyWindow.eruda?._isInit) {
proxyWindow.eruda.destroy();
} else {
let script = proxyDocument.createElement("script");
script.src = "https://cdn.jsdelivr.net/npm/eruda";
script.onload = function () {
if (!proxyWindow) return;
proxyWindow.eruda.init();
proxyWindow.eruda.show();
};
proxyDocument.head.appendChild(script);
}
}}
/>
<RiPictureInPictureExitFill
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
onClick={() => setShowPopout(true)}

View file

@ -28,8 +28,7 @@
"proxy": {
"title": "Proxy",
"subtitle": "Choose the proxy that fits your needs",
"automatic": "Automatic",
"buggyWarning": "(BUGGY)"
"automatic": "Automatic"
},
"languages": {
"title": "Language",

View file

@ -28,8 +28,7 @@
"proxy": {
"title": "Proxy",
"subtitle": "Elige el proxy que se ajuste a tus necesidades",
"automatic": "Automática",
"buggyWarning": "(CALESA)"
"automatic": "Automática"
},
"languages": {
"title": "Idioma",

View file

@ -28,8 +28,7 @@
"proxy": {
"title": "プロキシ",
"subtitle": "ニーズに合ったプロキシを選んでください",
"automatic": "自動",
"buggyWarning": "(バグ)"
"automatic": "自動"
},
"languages": {
"title": "言語",

View file

@ -3,6 +3,8 @@
"discord.com": "ultraviolet",
"example.org": "rammerhead",
"example.com": "ultraviolet",
"spotify.com": "dynamic",
"spotify.link": "dynamic",
"youtube.com": "dynamic",
"youtu.be": "dynamic"
}