79836906

Date: 2025-12-03 12:57:13
Score: 0.5
Natty:
Report link

since the referrer is a url in string form, we can use the URL class to turn it into an URL instance:

const referrerUrl = new URL(document.referrer);
console.log(referrerUrl.hostname);

Fiddle with google search urk as example: https://jsfiddle.net/d8oyw7u6/

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Grey