简体   繁体   English

防止 Ionic App iframe 中的浏览器选择器 - 防止打开外部浏览器

[英]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 内的提交(发送)按钮后:

带有提交按钮的 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM