google chrome - When will the tabId change -


i working on chrome extension capturing of web data. found change address bar can lead tabid change. has full idea when there change tabid?

by no means authoritative answer:

it has pre-rendering, , specific case may have instant search. type in address bar, chrome apparently pre-fetches , pre-renders pages faster navigation. if not trigger via address bar, chrome still can tab swapping performance reasons.

consider description of chrome.tabs.onreplaced:

fired when tab replaced tab due prerendering or instant.

or, this remark in chrome.webnavigation api docs:

not navigating tabs correspond actual tabs in chrome's ui, e.g., tab being pre-rendered. such tabs not accessible via tabs api nor can request information them via webnavigation.getframe or webnavigation.getallframes. once such tab swapped in, ontabreplaced event fired , become accessible via these apis.


to summarize:

for performance reasons chrome can spawn separate, invisible tab, , swap existing tab pre-rendered tab.

if happens, chrome.tabs.onreplaced event dispatched, providing old , new tabids.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -