Javascript 如何在iFrame中禁用/防止重定向?

Javascript 如何在iFrame中禁用/防止重定向?,javascript,html,iframe,ejs,embed,Javascript,Html,Iframe,Ejs,Embed,我们有以下两个iFrame: <iframe width="560" height="315" src="https://www.youtube.com/embed/DmiMpABb804" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; en

我们有以下两个iFrame:

<iframe width="560" height="315" src="https://www.youtube.com/embed/DmiMpABb804" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


YouTube iFrame的左下角有“在YouTube上观看”。这会将用户重定向到YouTube

Spotify iFrame的右上角有一个“Spotify徽标”,用于将用户重定向到Spotify

我们的目标:当用户点击/轻触其中任何一个时,都不会发生任何事情。


在此处直接打开嵌入式播放器:


这是我们无法控制的。您需要查看YT和Spotify的文档。你们可以用,但要搭配一些。@omkarbhagat好的。我不知道谦虚的品牌,谢谢你教育我。我们不能做点什么来完全阻止我们的网站重定向吗?事实上这很残酷。有没有办法限制某些div重定向?@omkarbhagat可能会阻止重定向到某些域?
<iframe src="https://open.spotify.com/embed/track/39LLxExYz6ewLAcYrzQQyP" width="300" height="380" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>