Closed ClarrieO5 closed 6 months ago
Especially Shadow Tabbed for me at least
This is, I think, a limitation with BareMux, which Ultraviolet uses internally. Specifically the fact that it doesn't properly register the transport (the software that transports the requests) the first time you load the page. Once it does load, you should be good to go and probably won't have it happen again. doing Ctrl + Shift + R
once or twice fixes it as well.
I personally have noticed this a lot and am trying to find a solid way to work around this for new users.
@Percslol what was the fix for this again
This is, I think, a limitation with BareMux, which Ultraviolet uses internally. Specifically the fact that it doesn't properly register the transport (the software that transports the requests) the first time you load the page. Once it does load, you should be good to go and probably won't have it happen again. doing
Ctrl + Shift + R
once or twice fixes it as well.I personally have noticed this a lot and am trying to find a solid way to work around this for new users.
Your issue is setting the transport before the service worker is ready, I already updated the ultraviolet docs to include this fix but its as easy as setting your transport when the service worker is ready like shown in the example.
navigator.serviceWorker.ready.then((sw) => {
SetTransport("EpxMod.EpoxyClient", { wisp: "wss://wisp.mercurywork.shop/" });
SetTransport("BareMod.BareClient", "https://example.com/bare/");
});
I've been setting it in a .then
after the register function, but I'll try this out
I've been setting it in a
.then
after the register function, but I'll try this out
Yeah turns out this is not really a fix as that promise only gets returned if the service worker is intercepting the current page.
This is the other react related fix (which can be adapted to other frameworks like solid)
export default function AppRoutes() {
const [init, setInit] = useState(false);
const [config] = useConfig("proxy");
useEffect(() => {
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("/sw.js", {
scope: "/~/",
})
.then(() => {
console.log(
"\x1b[34;49;1m[Ephemeral] \x1B[32mINFO: Service workers registered",
);
BareMux.registerRemoteListener(navigator.serviceWorker.controller);
BareMux.SetTransport(transports[config.transport], {
wisp: config.wispServer,
});
setInit(true)
})
.catch((err) => {
console.error(
"\x1b[34;49;1m[Ephemeral] \x1B[31mERROR: Service workers registration failed",
err,
);
});
} else {
console.error(
"\x1b[34;49;1m[Ephemeral] \x1B[31mERROR: Service workers are not supported on this device",
);
}
}, [config]);
return init ? <RouterProvider router={routes} /> : null;
}
this issue was resolved in 3.1.1, try updating uv-app if you are using it or updating your uv version if its your own custom frontend
closing as completed
That image pops up each time I then go to inspect and go to application. And clear web data and stuff. It works. But it happens every time, on multiple proxies that run ultraviolet. E.g emerald, ruby (only occasionally)