HTML DOM Document referrer
Description
The referrer property returns the URL of the document that loaded the current document.
The referrer property is read-only.
Note
Websites can set a Referrer-Policy.
This means that the referrer information can include only the origin and not the full URL.
This is a feature designed to protect the user's privacy.
Syntax
document.referrer
Return Value
| Type | Description |
| String | The URL of the document that loaded the current document. If the document was not opened with a link, an empty string is returned. |
Browser Support
document.referrer is a DOM Level 2 (2001) feature.
It is fully supported in all browsers:
| Chrome | Edge | Firefox | Safari | Opera | IE |
| Yes | Yes | Yes | Yes | Yes | 9-11 |