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");
if (!navigator.userAgent.includes("Firefox")) {
importScripts("/epoxy/index.js");
}
importScripts("/bare_transport.js")
importScripts("/uv/uv.bundle.js");
importScripts("/uv.config.js");

View file

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

View file

@ -73,9 +73,14 @@ export function getStaticPaths() {
await initTransport();
});
// Inject Epoxy, Libcurl, and Bare scripts into the DOM
// Firefox doesn't support the Epoxy transport, so we don't want to inject it.
if (!(navigator.userAgent.indexOf("Firefox") > 0)) {
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");
libcurlScript.src = "/libcurl/index.js";
document.body.appendChild(libcurlScript);