浏览器选项卡和窗口之间的区别

问题描述:

在Web浏览器中,每个窗口都有自己的JavaScript环境,并带有自己的
全局对象。但看起来在同一窗口中打开一个新选项卡也会创建一个不同的全局对象。这是真的吗?新标签和新窗口之间的主要区别是什么?

In web browsers each window has its own JavaScript environment, with its own global object. But it looks like that opening a new tab in the same window also creates a different global object. Is this really true? What is the main differences between a new tab and a new window?

唯一的区别是窗口如何呈现给用户。每个选项卡/窗口都有一个完全独立的DOM(文档对象模型)和JavaScript环境。

The only difference is how the window is presented to the user. Each Tab/Window has a totally separate DOM (Document Object Model) and JavaScript environment.

大多数浏览器将共享Cookie,因此会在选项卡和新窗口之间共享会话。有些人采用隐身模式阻止在隐身模式和普通模式窗口之间共享会话。

Most browsers will share Cookies and therefore Sessions between tabs and new windows. Some have an 'incognito' mode which prevents sharing of sessions between incognito and normal mode windows.