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

前端 未结 3 2013
灰色年华
灰色年华 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 06:03

    The promise fires in response to you getting the HTTP response back from the Ajax request. That isn't a user triggered event, so popups are blocked. Use the window the user gives you instead of creating a new one.

提交回复
热议问题