From d62a20f5316022ef501d75568efda49ada41138d Mon Sep 17 00:00:00 2001 From: artisticfox8 <77014769+artisticfox8@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:11:03 +0200 Subject: [PATCH] Fix inconsistent tab ordering by properly distributing TabOrderModifications --- background2.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/background2.js b/background2.js index 1e91acb..55a550d 100644 --- a/background2.js +++ b/background2.js @@ -388,6 +388,8 @@ function shareWithContentScripts(tabId, changeInfo, tab){ changedStuff.title = tab.title; changedStuff.url = tab.url; + //what if I send tabOrderModifications always and everywhere? + //=> That's what I do, but this part is not about sending, but about adding more keys if(String(tabId) in tabOrderModifications){ //tabId already, there, tab exists //the only data updated are the title and url properties @@ -401,11 +403,17 @@ function shareWithContentScripts(tabId, changeInfo, tab){ // } tabOrderModifications[tabId] = activeTabId } + + + changedStuff.tabOrderMods = tabOrderModifications; + browser.tabs.query({}).then(function(tabs){ - TabsObject = tabs; + TabsObject = tabs; + //ahaaa => this is a sync of the properties to TabsObject, which is sent to the newly loaded tab, but not a sync of the property to changedStuff, which I now want => added changedStuff.tabOrderMods = tabOrderModifications; a few lines above TabsObject.favicons = faviconCache; TabsObject.tabOrderMods = tabOrderModifications; + console.log("copak jsou tabOrderModifications undefined?: ", tabOrderModifications); TabsObject.settings = SettingsObject; console.log(changeInfo);