Merge pull request #1708 from thecodingmachine/fix_firefox_private_browsing
Fixing WA crashing in Firefox private mode
This commit is contained in:
commit
787cc508b8
@ -168,6 +168,9 @@ class ConnectionManager {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
if (err instanceof Error) {
|
||||||
|
console.error(err.stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const query = urlParams.toString();
|
const query = urlParams.toString();
|
||||||
|
@ -139,9 +139,13 @@ class LocalUserStore {
|
|||||||
async setLastRoomUrl(roomUrl: string): Promise<void> {
|
async setLastRoomUrl(roomUrl: string): Promise<void> {
|
||||||
localStorage.setItem(lastRoomUrl, roomUrl.toString());
|
localStorage.setItem(lastRoomUrl, roomUrl.toString());
|
||||||
if ("caches" in window) {
|
if ("caches" in window) {
|
||||||
|
try {
|
||||||
const cache = await caches.open(cacheAPIIndex);
|
const cache = await caches.open(cacheAPIIndex);
|
||||||
const stringResponse = new Response(JSON.stringify({ roomUrl }));
|
const stringResponse = new Response(JSON.stringify({ roomUrl }));
|
||||||
await cache.put(`/${lastRoomUrl}`, stringResponse);
|
await cache.put(`/${lastRoomUrl}`, stringResponse);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Could not store last room url in Browser cache. Are you using private browser mode?", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getLastRoomUrl(): string {
|
getLastRoomUrl(): string {
|
||||||
|
@ -78,6 +78,9 @@ export class ErrorScene extends Phaser.Scene {
|
|||||||
*/
|
*/
|
||||||
public static showError(error: unknown, scene: ScenePlugin): void {
|
public static showError(error: unknown, scene: ScenePlugin): void {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
if (error instanceof Error) {
|
||||||
|
console.error("Stacktrace: ", error.stack);
|
||||||
|
}
|
||||||
console.trace();
|
console.trace();
|
||||||
|
|
||||||
if (typeof error === "string" || error instanceof String) {
|
if (typeof error === "string" || error instanceof String) {
|
||||||
|
Loading…
Reference in New Issue
Block a user