I want to be able to focus on a specific tab.
After chrome.tabs.query
I get the id
but how do I set focus on that tab? I don't see this option in the documentation.
I want to be able to focus on a specific tab.
After chrome.tabs.query
I get the id
but how do I set focus on that tab? I don't see this option in the documentation.
You should be able to do this with chrome.tabs.update.
var updateProperties = { 'active': true };
chrome.tabs.update(tabId, updateProperties, (tab) => { });
You can also use https://developer.chrome.com/extensions/tabs#method-highlight
chrome.tabs.get(tabId, function(tab) {
chrome.tabs.highlight({'tabs': tab.index}, function() {});
});
shift
. When you "highlight" a tab, "activating" is just a side effect. You can only have one active tab per window but multiple highlighted tabs. –
Olives the easiest way to do this is with a extension of chrome "always active window"
© 2022 - 2025 — McMap. All rights reserved.