htmlsame-origin-policyreferrer

Using referrerPolicy in a video tag


i am currently building an app on react (i don't think it's relevant) and i have to use data from other websites.

First a picture, and then a video : i could block the referrer on the image tag

<img referrerPolicy="no-referrer" src="https://website/resource.jpg"></img>

, which is working perfectly.

On the video tag, however, i couldn't block it as the tag doesn't support this attribute,

<video id='video' controls  preload='metadata'>
            <source src="https://website/video.mp4" type='video/mp4'/>
        </video>

and adding

 <meta name="referer" content="no-referrer" />

in the header of my index.html was unfruitful as well.

Any ideas ? Thank you.


Solution

  • As you can see on for example https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy only the HTTP-header is the one miss-spelled with only one r.

    They have an example:

    <meta name="referrer" content="origin">
    

    (But you wanted no-referrer instead of origin)

    Some more info: Relevant warning from the same page but you seem to have done that one right.

    Warning: As seen above, the noreferrer link relation is written without a dash — noreferrer. When the referrer policy is specified for the entire document with a element, it's written with a dash: .