referrer

Gets the URL of the location that referred the user to the current page.

MDN Reference