You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.
When a tab becomes discarded from a previously-loaded state, its tabId is changed permanently. The previous Tab/WebContents is destroyed, and a new Tab/WebContents is created. The same happens for Chrome as for muon. However, in Chrome, an event (tabs.onReplaced) is exposed which provides the translation between the oldTabId and the newTabId.
This is important for consuming apps in order to present new incoming Tab/WebContents objects as 'new' by animating in, and not performing that animation for new Tab/WebContents objects which are previously known to the app. Since there is no other property to represent the Tab object uniquely, there is no other way to differentiate a 'new' tab versus a 'replaced' tab.
The only way to do this currently is to always have the tab attached to a <webview> object in a renderer window, and handle the tab-id-changed event inside the renderer window. This prevents being able to have only the active tab attached to a renderer window at a time, which has performance implications.
The text was updated successfully, but these errors were encountered:
@bridiver suggests that when we receive add-new-contents we should replace the existing contents if it there is one occupying the same index in the same windowId as the incoming contents.
If a tab is being inserted to an index (e.g. attached to a specific index), will the other tabs receive new indexes before this contents is inserted at the previously-occupied index?
...and another question about whether we'll get the new replacement Tab/WebContents before the old Tab/WebContents is destroyed, otherwise we'll still only know that a tab has been removed.
The answer appears to be yes based on the current sequence of events:
When a tab becomes
discarded
from a previously-loaded state, its tabId is changed permanently. The previous Tab/WebContents is destroyed, and a new Tab/WebContents is created. The same happens for Chrome as for muon. However, in Chrome, an event (tabs.onReplaced
) is exposed which provides the translation between the oldTabId and the newTabId.This is important for consuming apps in order to present new incoming Tab/WebContents objects as 'new' by animating in, and not performing that animation for new Tab/WebContents objects which are previously known to the app. Since there is no other property to represent the Tab object uniquely, there is no other way to differentiate a 'new' tab versus a 'replaced' tab.
The only way to do this currently is to always have the tab attached to a
<webview>
object in a renderer window, and handle thetab-id-changed
event inside the renderer window. This prevents being able to have only the active tab attached to a renderer window at a time, which has performance implications.The text was updated successfully, but these errors were encountered: