如何使用window.open和for循环多次打开Chrome中的新标签页?

例:

const openFollowedProfiles = () => {
    for (const profile of store.followed){
        console.log(profile)
        window.open(profile, '_blank');
    }
};

最佳答案

出于安全原因,您无法一次打开多个窗口。

每次您想要创建一个新窗口时,都必须获得用户与站点的交互(例如“ click”事件)。

关于javascript - JS如何多次循环打开新标签页,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/61163531/

10-14 14:48