The referer (or referrer) identifies the URL of the page where a link was clicked (ie where the request originated). It identifies the address of the web page that linked to the resource.
The referer may also be known as the request's initiator.
Its value is given in the referer header field written in a http request (referer is a misspelling of referrer. See HTTP referer note-1)
A referrer source is either:
The client, generally a browser would insert the following header in the http request
Referer: https://datacadamia.com/web/http/method
var referrer = parent.document.referrer;
// not in a iframe document.referrer;
console.log(referrer);
where:
The referrer policy modifies the algorithm used to populate the Referer header when fetching subresources, prefetching, or performing navigations.