"how to get the tab id where the chrome extension is opened" Code Answer

1

its actually very simple

chrome.tabs.query({active: true}, function(tabs){})

its is giving what are all the active window tabs and accessing other window dom(google.com)

chrome.tabs.query({active: true}, function(tabs){
  chrome.tabs.executescript(tabs[0].id,{   //tabs[0].id will give the tab id where extension is opened.
    code: 'document'  // any javascript statement
  })
})
By Ben Taliadoros on January 4 2022

Answers related to “how to get the tab id where the chrome extension is opened”

Only authorized users can answer the Search term. Please sign in first, or register a free account.