title: window.open - is there an Alternative code?
body: <p>In my code, once a user clicks on a button on my page, a new tab is supposed to be open, using the following JS code.</p>
  
  <p>It works fine on every browser, except on Google App Browser on iOS, where it simply opens a new blank tab and that's it.</p>
  
  <p>Here is a <a href="https://jsfiddle.net/befidd/r89hwm0j/10/" rel="nofollow noreferrer">Fiddle</a></p>
  
  <p>If you click on "Click" from any browser, a new tab will open going to 'next-page.php'
  However, if you have iOS and open this Fiddle from Google Search App, it will open just a blank tab.</p>
  
  <p>The code that seems to be not supported is on line 66 in Fiddle:</p>
  
  <pre><code>    wId = ''+new Date().getTime();
      w = window.open('about:blank','myPopup_Window' + wId);
      form.attr('target', 'myPopup_Window' + wId);
  </code></pre>
  
  <p>(I know it, because the other option in code, that's in the <code>IF</code> part, <em>does</em> work, though it has different functionality - it opens the target page in same page, and then opens a new tab with the original page).</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;label class="popup-button" data-tab-url="/next-page.php" data-tab-url-go="foo" data-popup-url="none" data-popup-url-go="foo"&gt;CLICK&lt;/label&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>(function($) {
      var check_mobile = true; // 
  
      var button_class1 = ".popup-button";
      var button_class3 = ".popup-button-flipped";
  
      var currentPopup = null;
      var currentPopupTab = null;
      var currentPopupXhr = null;
  
      var initOpenModal = false;
  
      var checkUrl = function(url) {
          if (!url)
              return url;
          return url.trim();
      };
  
      var getFormData = function(form) {
          var data = {};
          form.find(':input').each(function() {
              var n = $(this).attr('name');
              if (n) {
                  var v = $(this).val();
                  data[n] = v;
              }
          });
          return data;
      };
  
      var w = null;
      var wId = 0;
  
      var tryOpenTab2 = function(button,tab_url,tab_url_data_go) {
          var data = {};
          var form = button.parents('form').first();
          if (form.length &gt; 0)
              data = getFormData(form);
          if (tab_url_data_go) {
              data['go'] = tab_url_data_go
          }
  
          if (!tab_url)
              return;
  
          var form = $('&lt;form&gt;&lt;/form&gt;');
          form.attr('method', 'POST');
          form.attr('action', tab_url);
          for (var k in data) {
              var input = $('&lt;input /&gt;');
              input.attr('type', 'hidden');
              input.attr('name', k);
              input.attr('value', data[k]);
              form.append(input);
          }
          $('body').append(form);
  
          if (w &amp;&amp; !w.closed) {
  
              w = null;
          }
  
          if (button.is(button_class3)) {
              w = window.open(window.location.href.split('#')[0] + "#" + button.attr("data-popup-id"));
          } else {
              wId = ''+new Date().getTime();
              w = window.open('about:blank','myPopup_Window' + wId);
              form.attr('target', 'myPopup_Window' + wId);
              //wId++;
          }
  
          window.setTimeout(function(){
              form.submit();
  
              window.setTimeout(function(){form.remove();}, 0);
          },0);
      };
  
  
      var setPopups = function(button, no_one_time_check) {
          if (typeof no_one_time_check == "undefined")
              no_one_time_check = false;
  
          var tab_url = checkUrl(button.attr("data-tab-url"));
          if (tab_url == "none")
              tab_url = "";
  
  
  
          if ( initOpenModal || !button.is(button_class3)) {
              var popup_url = checkUrl(button.attr("data-popup-url"));
              { //check no show
                  var id = button.attr("data-popup-id");
                  var cn = "button-" + id + "-nopopup";
  
              }
              var popup_url_data_go = checkUrl(button.attr("data-popup-url-go"));
              var data = {};
              if (popup_url_data_go) {
                  data = {'go' : popup_url_data_go};
              }
  
          }
  
  
          if (!initOpenModal) {
              var tab_url_data_go = checkUrl(button.attr("data-tab-url-go"));
              tryOpenTab2(button, tab_url,tab_url_data_go);
          }
      };
  
      $(document).ready(function(){       
          var id = 0;
          $(button_class1 + "," + button_class3).each(function() {
              $(this).attr("data-popup-id", id++);
  
          });
  
          $(button_class1).each(function() {
              var button = $(this);
  
              button.on('click.popup-button', function() {
                  setPopups(button);
                  return false;
              });
          });
  
  
      });
  
  })(jQuery);
  </code></pre>