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="/dynamic/dynamic.config.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>
|
||||
<body style="margin: 0">
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {
|
|||
IoChevronForwardSharp,
|
||||
IoReloadSharp
|
||||
} from "react-icons/io5";
|
||||
import { FaShareAlt } from "react-icons/fa";
|
||||
import { FaShareAlt, FaPencilAlt } from "react-icons/fa";
|
||||
import { FaXmark } from "react-icons/fa6";
|
||||
|
||||
interface ProxyFrame extends HTMLElement {
|
||||
|
|
|
|||
|
|
@ -7,25 +7,39 @@ import { Radon } from "./pages/Radon";
|
|||
import { Settings } from "./pages/Settings/";
|
||||
import { AboutBlank } from "./AboutBlank";
|
||||
import { Faq } from "./pages/Faq";
|
||||
//import { setTransport } from "./util/transports.js";
|
||||
import { SetTransport } from "@mercuryworkshop/bare-mux";
|
||||
|
||||
import "./style.css";
|
||||
import "./i18n";
|
||||
import { setTransport } from "./util/transports";
|
||||
|
||||
export default function Routes() {
|
||||
//if ("serviceWorker" in navigator) {
|
||||
//window.addEventListener("load", () => {
|
||||
// navigator.serviceWorker
|
||||
// .register("/sw.js", {
|
||||
// scope: "/~/"
|
||||
// })
|
||||
// .then(() => {
|
||||
// console.log("Service worker registered successfully");
|
||||
// setTransport();
|
||||
// });
|
||||
//});
|
||||
//}
|
||||
const wispUrl =
|
||||
(location.protocol === "https:" ? "wss://" : "ws://") +
|
||||
location.host +
|
||||
"/wisp/"; // @TODO Japan - US ping
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
console.log("am bout to bus");
|
||||
navigator.serviceWorker
|
||||
.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 (
|
||||
<LocationProvider>
|
||||
<Router>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue