Merge pull request #410 from Jaxx7594/qr

Fix: QR code gen issues on Firefox
This commit is contained in:
Aden Lindsay
2026-03-21 09:10:44 +10:30
committed by GitHub
@@ -13,6 +13,13 @@
let isLoading = $state(false); let isLoading = $state(false);
let isStandalone = $state(false); let isStandalone = $state(false);
function isExtensionPage(): boolean {
return (
window.location.protocol === "chrome-extension:" ||
window.location.protocol === "moz-extension:"
);
}
function isSeqtaUrl(url: string): boolean { function isSeqtaUrl(url: string): boolean {
try { try {
const u = new URL(url); const u = new URL(url);
@@ -41,7 +48,7 @@
async function getSession(): Promise<{ baseUrl: string; jsessionId: string } | null> { async function getSession(): Promise<{ baseUrl: string; jsessionId: string } | null> {
let baseUrl: string | undefined; let baseUrl: string | undefined;
if (window.location.protocol === "chrome-extension:") { if (isExtensionPage()) {
// Extension popup: background will get URL from active tab // Extension popup: background will get URL from active tab
baseUrl = undefined; baseUrl = undefined;
} else { } else {
@@ -63,7 +70,7 @@
isLoading = true; isLoading = true;
try { try {
isStandalone = window.location.protocol === "chrome-extension:"; isStandalone = isExtensionPage();
const session = await getSession(); const session = await getSession();
if (!session) { if (!session) {
@@ -125,7 +132,7 @@
{#if showQrModal && qrDataUrl} {#if showQrModal && qrDataUrl}
<div <div
use:portal use:portal
class="fixed cursor-auto inset-0 z-[10000] flex justify-center items-center bg-black/50 backdrop-blur-sm" class="fixed cursor-auto inset-0 z-[10000] flex justify-center items-center bg-black/50 {isStandalone ? 'backdrop-blur-sm' : ''}"
role="button" role="button"
tabindex="-1" tabindex="-1"
onclick={(e) => { onclick={(e) => {