File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,13 +90,20 @@ function update(tabId) {
9090 } , 100 ) ;
9191}
9292async function updateInternal ( tabId ) {
93+ // tabs.onActivated can be notified before the tab is completely tracked...
94+ await Tab . waitUntilTracked ( tabId ) ;
95+ const tab = Tab . get ( tabId ) ;
96+ if ( ! tab )
97+ return ;
98+
9399 const promisedUpdate = mPromisedUpdatedSuccessorTabId . get ( tabId ) ;
94- if ( promisedUpdate )
95- await promisedUpdate . promisedSuccessorTabId ;
100+ await Promise . all ( [
101+ tab . $TST . opened ,
102+ promisedUpdate && promisedUpdate . promisedSuccessorTabId ,
103+ ] ) ;
104+
96105 const renewedTab = await browser . tabs . get ( tabId ) . catch ( ApiTabs . createErrorHandler ( ApiTabs . handleMissingTabError ) ) ;
97- const tab = Tab . get ( tabId ) ;
98106 if ( ! renewedTab ||
99- ! tab ||
100107 ! TabsStore . ensureLivingTab ( tab ) )
101108 return ;
102109 log ( 'updateInternal: ' , dumpTab ( tab ) , {
@@ -230,6 +237,7 @@ Tab.onCreating.addListener((tab, info = {}) => {
230237 configs . simulateSelectOwnerOnClose
231238 ) ;
232239
240+ log ( `shouldControlSuccesor: ` , shouldControlSuccesor ) ;
233241 if ( shouldControlSuccesor ) {
234242 // don't use await here, to prevent that other onCreating handlers are treated async.
235243 tryClearOwnerSuccessor ( info . activeTab ) . then ( ( ) => {
You can’t perform that action at this time.
0 commit comments