I'm currently working on developing a Firefox Extension and I'm facing a challenge. I'm trying to navigate to a specific browser tab in a different window. After reading through the Firefox Browser Extensions API documentation, I learned that I can adjust the focused window and the active tab within that window separately. I tried using the code below in my background script to accomplish this task. However, the browser behavior I encountered was less than ideal - it first shifted focus to the window with the previously active tab before moving to the desired tab, creating a glitchy effect.
browser.windows.update(windowId, {focused:true})
browser.tabs.update(tabId,{active:true})
Does anyone have suggestions on how I can seamlessly navigate to a different tab in another window in one smooth operation?
Any help is greatly appreciated!