CoolFace
Apppublic

AEUPH/AI-NPC-VR

sourceHugging Facecc-by-4.0updated 2y agoView on Hugging Face
0likes
index.html22 linesDownload Raw Back to root
1<script>2    function onDOMContentLoaded() {3        document.removeEventListener("DOMContentLoaded", onDOMContentLoaded);4        5        var currentUrl = window.location.href;6 7        var regex = /https:\/\/([\w]+)-([\w-]+)\.static\.hf\.space/;8        var match = currentUrl.match(regex);9 10        if (match) {11            var repo = match[1];12            var space = match[2];13            var targetUrl = "https://huggingface.co/spaces/" + repo + "/" + space;14            console.log("Redirecting to:", targetUrl);15            window.location.href = targetUrl;16        } else {17            console.error("URL pattern does not match.");18        }19    }20    document.addEventListener("DOMContentLoaded", onDOMContentLoaded);21</script>22