diff --git a/global.js b/global.js index 40c020f..8ee05de 100644 --- a/global.js +++ b/global.js @@ -14,12 +14,9 @@ document.addEventListener("DOMContentLoaded", function () { // Function to get URL parameters function getUrlParameter(name) { - name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); - var results = regex.exec(location.search); - return results === null - ? "" - : decodeURIComponent(results[1].replace(/\+/g, " ")); + url = document.location.href; + urlobj = new URL(url) + return urlobj.searchParams.get(name); } // Check if the 'embed' parameter is set to '1'