Merge branch 'rewrite' of https://github.com/IncognitoTGT/Nebula into rewrite
This commit is contained in:
commit
1b2f57e7d0
5 changed files with 36 additions and 30 deletions
|
|
@ -4,6 +4,12 @@ import { Link } from "preact-router";
|
||||||
import { RiPictureInPictureExitFill, RiFullscreenFill } from "react-icons/ri";
|
import { RiPictureInPictureExitFill, RiFullscreenFill } from "react-icons/ri";
|
||||||
import { IoCodeSlashSharp } from "react-icons/io5";
|
import { IoCodeSlashSharp } from "react-icons/io5";
|
||||||
import { FaXmark } from "react-icons/fa6";
|
import { FaXmark } from "react-icons/fa6";
|
||||||
|
|
||||||
|
interface ProxyFrame extends HTMLElement {
|
||||||
|
contentWindow: any;
|
||||||
|
contentDocument: any;
|
||||||
|
}
|
||||||
|
|
||||||
export function IframeHeader(props: { url: string }) {
|
export function IframeHeader(props: { url: string }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [showPopout, setShowPopout] = useState(false);
|
const [showPopout, setShowPopout] = useState(false);
|
||||||
|
|
@ -38,29 +44,30 @@ export function IframeHeader(props: { url: string }) {
|
||||||
<IoCodeSlashSharp
|
<IoCodeSlashSharp
|
||||||
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const proccy = document.getElementById("iframe");
|
const proxyFrame: ProxyFrame | null = document.getElementById(
|
||||||
if (!proccy) return;
|
"iframe"
|
||||||
// @ts-ignore
|
) as ProxyFrame;
|
||||||
const proccyWindow = proccy.contentWindow;
|
if (!proxyFrame) return;
|
||||||
// @ts-ignore
|
|
||||||
const proccyDocument = proccy.contentDocument;
|
|
||||||
|
|
||||||
if (!proccyWindow || !proccyDocument) return;
|
const proxyWindow = proxyFrame.contentWindow;
|
||||||
|
|
||||||
if (proccyWindow.eruda?._isInit) {
|
const proxyDocument = proxyFrame.contentDocument;
|
||||||
proccyWindow.eruda.destroy();
|
|
||||||
|
if (!proxyWindow || !proxyDocument) return;
|
||||||
|
|
||||||
|
if (proxyWindow.eruda?._isInit) {
|
||||||
|
proxyWindow.eruda.destroy();
|
||||||
} else {
|
} else {
|
||||||
let script = proccyDocument.createElement('script');
|
let script = proxyDocument.createElement("script");
|
||||||
script.src = "https://cdn.jsdelivr.net/npm/eruda";
|
script.src = "https://cdn.jsdelivr.net/npm/eruda";
|
||||||
script.onload = function() {
|
script.onload = function () {
|
||||||
if (!proccyWindow) return;
|
if (!proxyWindow) return;
|
||||||
proccyWindow.eruda.init();
|
proxyWindow.eruda.init();
|
||||||
proccyWindow.eruda.show();
|
proxyWindow.eruda.show();
|
||||||
}
|
};
|
||||||
proccyDocument.head.appendChild(script);
|
proxyDocument.head.appendChild(script);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<RiPictureInPictureExitFill
|
<RiPictureInPictureExitFill
|
||||||
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,7 @@
|
||||||
"proxy": {
|
"proxy": {
|
||||||
"title": "Proxy",
|
"title": "Proxy",
|
||||||
"subtitle": "Choose the proxy that fits your needs",
|
"subtitle": "Choose the proxy that fits your needs",
|
||||||
"automatic": "Automatic",
|
"automatic": "Automatic"
|
||||||
"buggyWarning": "(BUGGY)"
|
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"title": "Language",
|
"title": "Language",
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,7 @@
|
||||||
"proxy": {
|
"proxy": {
|
||||||
"title": "Proxy",
|
"title": "Proxy",
|
||||||
"subtitle": "Elige el proxy que se ajuste a tus necesidades",
|
"subtitle": "Elige el proxy que se ajuste a tus necesidades",
|
||||||
"automatic": "Automática",
|
"automatic": "Automática"
|
||||||
"buggyWarning": "(CALESA)"
|
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"title": "Idioma",
|
"title": "Idioma",
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,7 @@
|
||||||
"proxy": {
|
"proxy": {
|
||||||
"title": "プロキシ",
|
"title": "プロキシ",
|
||||||
"subtitle": "ニーズに合ったプロキシを選んでください",
|
"subtitle": "ニーズに合ったプロキシを選んでください",
|
||||||
"automatic": "自動",
|
"automatic": "自動"
|
||||||
"buggyWarning": "(バグ)"
|
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"title": "言語",
|
"title": "言語",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
"discord.com": "ultraviolet",
|
"discord.com": "ultraviolet",
|
||||||
"example.org": "rammerhead",
|
"example.org": "rammerhead",
|
||||||
"example.com": "ultraviolet",
|
"example.com": "ultraviolet",
|
||||||
|
"spotify.com": "dynamic",
|
||||||
|
"spotify.link": "dynamic",
|
||||||
"youtube.com": "dynamic",
|
"youtube.com": "dynamic",
|
||||||
"youtu.be": "dynamic"
|
"youtu.be": "dynamic"
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue