【问题标题】:How to open link in external browser instead of in-app (instagram, IPhone)?如何在外部浏览器而不是应用内(instagram、iPhone)中打开链接?
【发布时间】:2021-02-01 01:56:34
【问题描述】:

如果我在 Instagram 应用中有链接,则该链接会从 iOS 中打开一个应用内浏览器... 是否可以改为打开外部浏览器? 我尝试了很多东西,比如将 window.open 与 _blank、_system、_self 和

一起使用
  <script>
   if(navigator.userAgent.includes("Instagram")){
       window.location.href = "https://mywebsite.com/DummyBytes";
   }
  </script>

这个也是

我的环境

  • ruby2.4.5
  • 导轨
  • javascript
  • jquery

【问题讨论】:

    标签: javascript ruby-on-rails ruby cross-browser instagram


    【解决方案1】:

    试试window.open

      <script>
       if(navigator.userAgent.includes("Instagram")){
           window.open("https://mywebsite.com/DummyBytes")
       }
      </script>
    
    

    https://www.w3schools.com/jsref/met_win_open.asp

    【讨论】:

    • window.open ios14 不再支持。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-30
    • 1970-01-01
    • 2021-09-16
    • 1970-01-01
    • 2011-12-01
    相关资源
    最近更新 更多