【问题标题】:JavaScript Redirection not working in Facebook in-app browserJavaScript 重定向在 Facebook 应用内浏览器中不起作用
【发布时间】:2021-09-07 03:10:25
【问题描述】:

我们在网站上有一个中心网页,可根据特定条件将用户重定向到某个特定页面。 重定向逻辑用 JavaScript 编码,使用 window.location.href 但是这种重定向在 Facebook In-App Browser 中总是失败,它在除 Facebook In-App-Browser 版本 323 之外的所有其他移动浏览器中都能正常工作。

我已经尝试了下面列出的所有其他可能的 JavaScript 重定向选项,但似乎都失败了。

<html><body><script type='text/javascript'> window.open("http://conv-test.mnetads.com/client-side-second-hop/");</script></body>


<html><body><script type='text/javascript'> eval('window.location.href ="http://conv-test.mnetads.com/client-side-second-hop/"');</script></body>

<html><body><script type='text/javascript'> setTimeout(window.location.href ="http://conv-test.mnetads.com/client-side-second-hop/", 10000);</script></body>


<html><body><script type='text/javascript'> setTimeout(window.onload = function(e){ location.replace("http://conv-test.mnetads.com/client-side-second-hop/"); }, 5000);</script></body>

<html><body><script type='text/javascript'>  window.location ="http://conv-test.mnetads.com/client-side-second-hop/";</script></body></html>
// Sets the new location of the current window.

<html><body><script type='text/javascript'>  window.location.assign("http://conv-test.mnetads.com/client-side-second-hop/");</script></body></html>
// Assigns a new URL to the current window.

<html><body><script type='text/javascript'>  window.location.replace("http://conv-test.mnetads.com/client-side-second-hop/");</script></body></html>
// Replaces the location of the current window with the new one.


<html><body><script type='text/javascript'>  self.location ="http://conv-test.mnetads.com/client-side-second-hop/";</script></body></html>
// Sets the location of the current window itself.

<html><body><script type='text/javascript'>  top.location ="http://conv-test.mnetads.com/client-side-second-hop/";</script></body></html>
// Sets the location of the topmost window of the current window.

<html><body><a href="http://conv-test.mnetads.com/client-side-noreferrer/" id="max">Max</a><script type="text/javascript"> document.getElementById("max").click();</script></body></html>

<html><body><script type='text/javascript'>document.location.href ="http://conv-test.mnetads.com/client-side-second-hop/";</script></body></html>

<http-equiv="refresh" content="0; url='http://conv-test.mnetads.com/client-side-second-hop/'">

【问题讨论】:

  • 我们有同样的问题。主要围绕Android设备。 link.click() 也停止工作
  • 是的 link.click() 也不起作用

标签: javascript redirect inappbrowser facebook-browser


【解决方案1】:

这是一个错误。并且在即将发布的新版本中已修复。我已经测试过了。

【讨论】:

  • 您是指新版 Facebook 应用?知道如何处理在不久的将来一段时间内不会更新其应用的用户吗?
【解决方案2】:

现在有一个新版本的 Facebook 应用程序。 JavaScript 重定向在 facebook 应用内浏览器中工作。 ?

【讨论】:

    【解决方案3】:

    v323.0.0.46.119 是有问题的版本。新版本v324.0.0.48.120没有这个bug。

    【讨论】:

      猜你喜欢
      • 2015-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-13
      • 1970-01-01
      • 2014-01-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多