Attempt to prevent Alu from allowing Epoxy to load, as it causes the tab to hang (firefox bug)

This commit is contained in:
wearrrrr 2024-03-29 23:07:06 -05:00
parent c56fff2e78
commit 774f26066b
3 changed files with 15 additions and 5 deletions

View file

@ -1,5 +1,7 @@
importScripts("/libcurl/index.js"); importScripts("/libcurl/index.js");
importScripts("/epoxy/index.js"); if (!navigator.userAgent.includes("Firefox")) {
importScripts("/epoxy/index.js");
}
importScripts("/bare_transport.js") importScripts("/bare_transport.js")
importScripts("/uv/uv.bundle.js"); importScripts("/uv/uv.bundle.js");
importScripts("/uv.config.js"); importScripts("/uv.config.js");

View file

@ -25,6 +25,9 @@ export default class TransportManager {
if (transport) { if (transport) {
this.transport = transport; this.transport = transport;
} }
if (navigator.userAgent.includes("Firefox")) {
this.transport = "BareMod.BareClient";
}
if (localStorage.getItem("alu__selectedTransport") != null && !transport) { if (localStorage.getItem("alu__selectedTransport") != null && !transport) {
this.transport = JSON.parse(localStorage.getItem("alu__selectedTransport")!).value; this.transport = JSON.parse(localStorage.getItem("alu__selectedTransport")!).value;
} }

View file

@ -72,10 +72,15 @@ export function getStaticPaths() {
} }
await initTransport(); await initTransport();
}); });
// Inject Epoxy, Libcurl, and Bare scripts into the DOM // Inject Epoxy, Libcurl, and Bare scripts into the DOM
let epoxyScript = document.createElement("script"); // Firefox doesn't support the Epoxy transport, so we don't want to inject it.
epoxyScript.src = "/epoxy/index.js"; if (!(navigator.userAgent.indexOf("Firefox") > 0)) {
document.body.appendChild(epoxyScript); let epoxyScript = document.createElement("script");
epoxyScript.src = "/epoxy/index.js";
document.body.appendChild(epoxyScript);
} else {
console.log("Firefox detected, not injecting Epoxy transport!");
}
let libcurlScript = document.createElement("script"); let libcurlScript = document.createElement("script");
libcurlScript.src = "/libcurl/index.js"; libcurlScript.src = "/libcurl/index.js";
document.body.appendChild(libcurlScript); document.body.appendChild(libcurlScript);