Is it possible to remove referrer when using iframe? here the case:
I have a page at http://www.mywebsite.com with an in it. Like this:
Using an iframe with a javascript location redirect works:
<iframe style="display:none" src="javascript:parent.location.replace('http://www.whatismyreferer.com/'+(parent.location.hash||''))">
Note that on some browsers when using HTTP, the last referrer will always be sent, which will be domain owning the iframe. Using HTTPS (and a valid certificate) ensures a hidden referrer on all browsers tested.
<iframe id="#loadiframe" src='javascript:window.location.replace("http://www.iframetarget.tld")'>
It works.
None of these answers worked for me, but I came across this on MDN stating that setting the referrerpolicy
to no-referrer
would accomplish this.
Example:
<iframe src="https://www.whatismyreferer.com/" referrerpolicy="no-referrer"></iframe>