Javascript pathname referrer
No, you can only extract needed part manually:
document.referrer.replace(/^[^:]+:\/\/[^/]+/, '').replace(/#.*/, '')
You can extract the pathname from the document.referrer
and parse it with new URL()
with the following code
const url = new URL(document.referrer)
url.pathname
Be sure to polyfill URL for IE 10 and below, easily done with https://polyfill.io/v3/polyfill.js?features=URL