Closed Greenheart closed 8 months ago
The following can be simplified, from this:
https://github.com/Greenheart/pagecrypt/blob/4571f6673b45234da4375d946d65f01c9acd9edf/web/decrypt.ts#L41-L44
To this:
const parts = location.href.split('#') pwd.value = parts[1] history.replaceState(null, '', parts[0])
This works because location.href.split('#') always returns the href without the URL hash, no matter if it is present or not.
location.href.split('#')
The following can be simplified, from this:
https://github.com/Greenheart/pagecrypt/blob/4571f6673b45234da4375d946d65f01c9acd9edf/web/decrypt.ts#L41-L44
To this:
This works because
location.href.split('#')
always returns the href without the URL hash, no matter if it is present or not.