关于浏览器弹出拦截窗口

之前是直接使用接口去弹窗,浏览器默认为广告,自动拦截
可以先弹一个空窗口,再给url

之前的写法例子

this.get(url).then(res => {
        if (res.result == true) {
           window.open(res.data, '_blank', 'top=300,left=300,width=800,height=500,menubar=no,toolbar=no,status=no,scrollbars=yes');
        }
      });

修改后的样子

let newLink = window.open('', '_blank', 'top=300,left=300,width=800,height=500,menubar=no,toolbar=no,status=no,scrollbars=yes');
     this.get(url).then(res => {
        if (res.result == true) {
          newLink.location.href = res.data;
        }
      });
原文地址:https://www.cnblogs.com/zxli/p/14976262.html