Captive Wifi Popup: Click a link to open Safari

前端 未结 3 2006
独厮守ぢ
独厮守ぢ 2021-01-31 18:27

We are having an issue on our network with iOS devices (ipads, iphones etc): After connecting to the SSID, the iphone / ipad immediately opens the Captive Network Assistant (CNA

3条回答
  •  暖寄归人
    2021-01-31 18:51

    Extracted from an answer by Ryan at How can I open an external link in Safari not the app's UIWebView?

    To have a specific link switch to Safari, simply add target="_system" to the link, as in

    Link Text
    

    Or to catch all links in your javascript that have target="_blank", include jQuery and pass them to window.open with the '_system' param. This will work on both iOS and Android.

    $(document).on('click', 'a[target="_blank"]', function(ev) {
      var url;
    
      ev.preventDefault();
      url = $(this).attr('href');
      window.open(url, '_system');
    });
    

提交回复
热议问题