在 iframe 上隐藏引用 [英] Hide referrer on iframe
本文介绍了在 iframe 上隐藏引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 iframe 时是否可以删除引用?这里的情况:
Is it possible to remove referrer when using iframe? here the case:
我在 http://www.mywebsite.com 上有一个带有 的页面在里面.像这样:
I have a page at http://www.mywebsite.com with an <iframe>
in it. Like this:
<html>
<head>...</head>
<body>
...
<a href="#loadiframe">SHow Website</a>
<iframe id="#loadiframe" src="http://www.iframetarget.tld">
...
</body>
</html>
我想 iframetarget.tld 不包含引用者/无法查看 mywebsite.com 是否正在加载他们的页面.
i want to iframetarget.tld not contains referrer/can not see if mywebsite.com is loading their pages.
这可能吗?
注意:iframe 将使用 jQuery lightbox/colorbox 加载
Note: iframe will load using jQuery lightbox/colorbox
推荐答案
这些答案都不适合我,但是 MDN 的 iframe 参考 指出将 referrerpolicy
设置为 no-referrer
将实现这一点.
None of these answers worked for me, but MDN's iframe reference states that setting the referrerpolicy
to no-referrer
will accomplish this.
示例:
<iframe src="https://whatsmyreferer.com/" referrerpolicy="no-referrer" style="width: 100%; height: 300px;"></iframe>
这篇关于在 iframe 上隐藏引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文