Concerning the information provided about the sender
from a runtime.onConnect
listener, I’m having trouble understanding the sender.tab.index
?
It appears to be inaccurate. If a browser.tabs.get( sender.tab.id )
is performed, the index of the returned tabs.Tab
object is a different value than sender.tab.index
.
My scenario is a content script sends a message to the background script invoking a duplication of a different tab, and that new tab is moved to the right of the tab holding the content script. Using the sender.tab.index
in a browser.tabs.move
to position the new tab doesn’t place it in the correct position; but getting new tab information for the sender.tab.id
and using the returned index places the new tab in the correct position.
I’d just like to understand why and what I am missing.
I’m not certain but it appears that the sender.tab.index
is relative to only those tabs meeting the manifest.json
match pattern.
Thank you.