            return !param.startsWith("alert");
          });

        // Add alert to params
        if (alert) {
          paramsFiltered.push(`alert=${alert}`);
        }

        // set #link to the new URL
        const newUrl = location + "?" + paramsFiltered.join("&");
        const qrUrl = location + "qr?" + paramsFiltered.join("&");
        document.querySelector("#link").href = newUrl;
        document.querySelector("#link").text = newUrl;
        document.querySelector("#qr").src = qrUrl;

       