From: Ardis Lu Date: Tue, 3 Oct 2023 04:27:09 +0000 (-0700) Subject: Use href instead of origin X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=246649a3ac0111821c181f3025d8c9c29611f99a;p=zip-page Use href instead of origin Enables offline usage on file: URL scheme --- diff --git a/index.html b/index.html index 128b5af..c4344e1 100644 --- a/index.html +++ b/index.html @@ -145,7 +145,7 @@ const content = new FormData(e.target).get('content'); const b64 = await textToGzipBase64(content); - const url = `${location.origin}/#${b64}`; + const url = `${location.href}#${b64}`; e.target.elements['url'].innerHTML = `${url.substring(0, 60)}${url.length > 60 ? '...' : ''}`; });