[英]Prevent browser selector in an Ionic App iframe - Prevent open external browser
I am using iframe for payment page in an ionic application.我在离子应用程序中使用 iframe 作为支付页面。 after clicking submit (Senden) button inside the iframe:
单击 iframe 内的提交(发送)按钮后:
A popup with browsers appear like this:带有浏览器的弹出窗口如下所示:
How can I prevent this popup from appearing?如何防止出现此弹出窗口?
I use targer="_self"
in the iframe.我在 iframe 中使用
targer="_self"
。 but it doesn't work.但它不起作用。
I've removed allow-popups allow-top-navigation
from sandbox
attribute of the iframe
.我已经从
iframe
sandbox
属性中删除了allow-popups allow-top-navigation
。
iframe before the fix:修复前的 iframe:
<iframe #iframe id="iframe"
frameborder="0"
[src]="url"
style="width:100%; border:none;"
sandbox="allow-popups allow-top-navigation allow-presentation allow-scripts allow-pointer-lock allow-same-origin allow-forms">
</iframe>
iframe now:现在 iframe:
<iframe #iframe id="iframe"
frameborder="0"
[src]="url"
style="width:100%; border:none;"
sandbox="allow-presentation allow-scripts allow-pointer-lock allow-same-origin allow-forms">
</iframe>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.