There ARE bare clients !?
This commit is contained in:
parent
aba3153c4f
commit
b152154cf0
3 changed files with 29 additions and 34 deletions
19
index.html
19
index.html
|
|
@ -10,25 +10,6 @@
|
||||||
<script src="/uv/uv.config.js" defer></script>
|
<script src="/uv/uv.config.js" defer></script>
|
||||||
<script src="/dynamic/dynamic.config.js" defer></script>
|
<script src="/dynamic/dynamic.config.js" defer></script>
|
||||||
<script src="/localforage/localforage.min.js" defer></script>
|
<script src="/localforage/localforage.min.js" defer></script>
|
||||||
<script>
|
|
||||||
if ("serviceWorker" in navigator) {
|
|
||||||
window.addEventListener("load", () => {
|
|
||||||
navigator.serviceWorker
|
|
||||||
.register("/sw.js", {
|
|
||||||
scope: "/~/"
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
console.log("Service Worker Registered");
|
|
||||||
try {
|
|
||||||
window.setTransport();
|
|
||||||
} catch {}
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error("Service Worker Failed to Register", err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body style="margin: 0">
|
<body style="margin: 0">
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import {
|
||||||
IoChevronForwardSharp,
|
IoChevronForwardSharp,
|
||||||
IoReloadSharp
|
IoReloadSharp
|
||||||
} from "react-icons/io5";
|
} from "react-icons/io5";
|
||||||
import { FaShareAlt } from "react-icons/fa";
|
import { FaShareAlt, FaPencilAlt } from "react-icons/fa";
|
||||||
import { FaXmark } from "react-icons/fa6";
|
import { FaXmark } from "react-icons/fa6";
|
||||||
|
|
||||||
interface ProxyFrame extends HTMLElement {
|
interface ProxyFrame extends HTMLElement {
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,39 @@ import { Radon } from "./pages/Radon";
|
||||||
import { Settings } from "./pages/Settings/";
|
import { Settings } from "./pages/Settings/";
|
||||||
import { AboutBlank } from "./AboutBlank";
|
import { AboutBlank } from "./AboutBlank";
|
||||||
import { Faq } from "./pages/Faq";
|
import { Faq } from "./pages/Faq";
|
||||||
//import { setTransport } from "./util/transports.js";
|
import { SetTransport } from "@mercuryworkshop/bare-mux";
|
||||||
|
|
||||||
import "./style.css";
|
import "./style.css";
|
||||||
import "./i18n";
|
import "./i18n";
|
||||||
import { setTransport } from "./util/transports";
|
|
||||||
|
|
||||||
export default function Routes() {
|
export default function Routes() {
|
||||||
//if ("serviceWorker" in navigator) {
|
const wispUrl =
|
||||||
//window.addEventListener("load", () => {
|
(location.protocol === "https:" ? "wss://" : "ws://") +
|
||||||
// navigator.serviceWorker
|
location.host +
|
||||||
// .register("/sw.js", {
|
"/wisp/"; // @TODO Japan - US ping
|
||||||
// scope: "/~/"
|
|
||||||
// })
|
if ("serviceWorker" in navigator) {
|
||||||
// .then(() => {
|
console.log("am bout to bus");
|
||||||
// console.log("Service worker registered successfully");
|
navigator.serviceWorker
|
||||||
// setTransport();
|
.register("/sw.js", {
|
||||||
// });
|
scope: "/~/"
|
||||||
//});
|
})
|
||||||
//}
|
.then(() => {
|
||||||
|
console.log("Service Worker Registered");
|
||||||
|
try {
|
||||||
|
localStorage.setItem("transport", "libcurl");
|
||||||
|
console.log("Setting transport to Libcurl");
|
||||||
|
SetTransport("CurlMod.LibcurlClient", {
|
||||||
|
wisp: wispUrl
|
||||||
|
});
|
||||||
|
} catch {}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error("Service Worker Failed to Register", err);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("err");
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<LocationProvider>
|
<LocationProvider>
|
||||||
<Router>
|
<Router>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue