javascript - 打开新选项卡时强制 chrome 启动全新进程

标签 javascript google-chrome

如果我有以下小JS函数

function newWin() {
var win = window.open("www.google.com") //should open new tab in chrome
}

运行此 chrome 时,会将内存分组到一个进程中,以供打开的任何新选项卡使用。

有没有办法强制这个打开的窗口不与其父窗口共享内存?

最佳答案

我发现一个2009年的页面说可以这样做

Now, thanks to a new HTML 5 feature that got implemented in the latest builds of the Webkit HTML engine, which powers Chorme, Safari and a bunch of desktop and mobile browsers, developers can make links on their sites open in a new process adding a new level of protection. All they need to do is add the new rel="noreferrer" attribute as well as a target=”_blank” to their links pointing to another domain.

Read more: http://news.softpedia.com/news/Force-Google-Chrome-to-Open-Links-in-New-Processes-128962.shtml#ixzz46RXwpFl0

此外,同一页面上的评论说:

You can force Chrome to open each new tab in a new process:

"If you add the string '-process-per-site' to the Target line, Chrome will open a new process for each tab, but if you open the same site in two tabs, it will run them on the same process. The string '-process-per-tab' will force Chrome to create a completely new process and use a new memory space for each tab, which is its default."

http://www.techradar.com/news/internet/10-really-cool-google-chrome-hacks-501492?artc_pg=2

Read more: http://news.softpedia.com/news/Force-Google-Chrome-to-Open-Links-in-New-Processes-128962.shtml#ixzz46RYCBXua

关于javascript - 打开新选项卡时强制 chrome 启动全新进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36762346/

相关文章:

html - 图像上的文本在 Chrome/Firefox 中居中,但在 Safari 中不居中

javascript - 无法为内容脚本加载 JavaScript 'content_script.js'

javascript - XRM setDisable() 在 IE 以外的浏览器上不起作用

javascript - 单击编辑器上的工具栏按钮时不将焦点集中到 Froala 编辑器的编程方法是什么。$el(文本区域)

javascript - Jquery Slider TypeError : $(. ..).getElementsByTagName 不是函数

javascript - window.opener 不同的按钮和输入类型=按钮

css - Spry 验证文本字段在谷歌浏览器中显示不佳

macos - NET::ERR_CERT_INVALID 在 MacOS 上的 Chrome 中没有 “Proceed Anyway” 选项

javascript - Sequelize include 不适用于 hasOne 关系

javascript - 无法将新数据添加到基于 switch case 的数组