【问题标题】:Changing iframe URL to another protocol reloads the page, but not when fired from a timer将 iframe URL 更改为另一个协议会重新加载页面,但不会在从计时器触发时重新加载
【发布时间】:2013-09-11 15:33:55
【问题描述】:

我的理论是,Chrome@Android 的后续版本在非“用户触发”时会停止以下行为。
我的问题是是否有人找到了解决方法。


iframe 上使用另一个架构设置 src 会使设备打开一个应用程序。
好吧..它适用于某些浏览器@设备。

一年以来,它一直适用于“所有”设备,但不久前就没有了。

当我像这样通过点击触发此事件时,它会起作用:
(这适用于“所有”设备)

$("#myAnchor").click( function() {
    $("#myIframe").attr( 'src', 'schema://redirect=whatever' );
});

但不是来自这样的计时器:
(即这适用于 ie10metro@win8、safari@ios 和opera@android,但不适用于 chrome@android)

window.setTimeout( function() {
    $("#myIframe").attr( 'src', 'schema://redirect=whatever' );
}, 1000 );

【问题讨论】:

    标签: javascript ios google-chrome iframe


    【解决方案1】:

    我们阻止后者在 Chrome 中工作,当时它被滥用于重定向到 Playstore 或其他应用程序。 (注意:我实际上认为我们也阻止了前者的工作)。

    首选的解决方案是使用意图锚语法https://developers.google.com/chrome/mobile/docs/intents

    【讨论】:

      猜你喜欢
      • 2013-01-18
      • 1970-01-01
      • 2019-07-29
      • 2017-01-13
      • 2023-03-31
      • 2015-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多