window.open() is blocked by browser when is called from promise

前端 未结 3 2023
灰色年华
灰色年华 2020-12-19 05:22

I have code like this:

window.open(\'https://api.instagram.com/oauth/authorize/\',
\'_blank\',
\'width=700,height=500,toolbar=0,menubar=0,location=0,status=1         


        
3条回答
  •  情话喂你
    2020-12-19 05:58

                var newTab = $window.open('', '_blank');
            promise
                .then(function () {
                    var url = '...';
                    newTab.location.href = url;
                });
    

提交回复
热议问题