Open In App
Related Articles

HTML <img> referrerpolicy Attribute

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

The HTML <img> referrerpolicy attribute is used to specify the reference information that will be sent to the server when fetching the image. 

Syntax:

<img referrerpolicy="value">  

Attribute Values : 

  • no-referrer: It specifies that no reference information will be sent along with a request.
  • no-referrer-when-downgrade: It has a default value. It specifies that refer header will not be sent to origins without HTTPS.
  • origin: It specifies to send the origin of the document as the referrer in all cases.
  • origin-when-cross-origin: It sends the origin, path, and query string when performing a same-origin request, but only send the origin of the document for other cases.
  • unsafe-url: It sends origin. path and query string but not include fragment, password and username.

Example: Below code illustrates the use of <img> referrer policy attribute. 

HTML

<!DOCTYPE html>
<html>
 
<body>
    <h1>GeeksforGeeks</h1>
 
    <h2>
        HTML img referrerpolicy Attribute
    </h2>
    <img src=
        alt="GeeksforGeeks logo" referrerpolicy="no-referrer"
     >
</body>
 
</html>

                    

Output:

Supported Browsers:

  • Google Chrome 51.0
  • Edge 79.0
  • Internet Explorer Not Supported
  • Firefox 50.0
  • Safari 14.0
  • Opera 38.0

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!


Last Updated : 20 Jul, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials