Check if pop-up blocker is enbled when open new tab

烈酒焚心 提交于 2019-12-05 02:18:28
cytsunny

Not very sure do you want to make sure to open a new window or new process, so maybe I will answer both.

If you literally means you want to make sure Chrome starts a new process, there is no way to do that in Javascript, not even the code you shown with window.open. However, as Chrome is opening a new process for every tab, it is safe to assume your message is in a new process as long as your user is using Chrome. Checking what browser your user is using, on the other hand, is possible. Although your user may still fake the user agent (i.e. the browser), it should be quite enough for internal use.

More reference on Chrome using new process instead of new thread for each tab.

If you want to make sure your user is opening your message in a new window, the one with window.open is the only option. You may trigger window.open by adding event listener or simply use the onclick attribute in HTML. There is no way to do with HTML alone, and there should be no reason to search for answer when you have already found a way to do that with javascript?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!