I need to know if the chrome tabId is unique across all the open windows. Incognito and normal. Is it guaranteed that non of the open tabs in all the windows will have the same tabId ?
I searched the documentation but could not find any reliable answer.
chrome. windows. getCurrent(function (win) { callback(win.id) }); to get window Id.
Email all open tabs in current window. Keyboard Shortcut: Alt + M. Use the button on browser toolbar, or the keyboard shortcut command: alt + m. Option to set default multiple recipients, cc & bcc addresses.
Yes, the tab ID is unique within a browser session. It's also mentioned in the documentation of chrome.tabs
:
Tab
( object )
id ( integer )
The ID of the tab. Tab IDs are unique within a browser session.
If you still don't believe it, create an extension which has the tabs
permission, and the right to run in an incognito window. Then run the following code in the background page:
// Create incognito window
chrome.windows.create({incognito: true, url:'about:blank'}, showTabId);
// Create normal window
chrome.windows.create({incognito: false, url:'about:blank'}, showTabId);
function showTabId(_window) {
console.log(_window.tabs[0].id); // Or alert, whatever.
chrome.tabs.remove(_window.tabs[0].id); // Closes tab & window, user-friendly
}
The logged numbers are increasing (if you consider two numbers as a too small sample, run the chrome.windows.create
method in a loop, until you believe it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With