When the browser detects a new pop-up created by a non-user action, it blocks it. Because the browser thinks this is not a page the user wants to see.

Solution: Manually create an A tag and add the href attribute to it. Click the a tag to jump to it.

    const a = document.createElement('a')
    document.body.appendChild(a)
    a.href = http://www.baidu.com'
    a.target = '_blank'
    a.click()
    document.body.removeChild(a)
Copy the code