Open New Tab After Current Tab (CloudMonk.io)
Open New Tab After Current Tab
Return to Browser Tabs, OneTab
ddg>Open New Tab After Current Tab
Opens new tab after the active tab, instead of last position.
By default a new tab is opened at the end of the row of tabs, but it's not intuitive --- in fact, it is INSANE!!!
With this extension a new tab opened with the keyboard shortcut (⌘ Cmd+T) or with the "plus" button will be opened just after the current active tab, "as God intended it".
* https://chromewebstore.google.com/detail/open-new-tab-after-curren/mmcgnaachjapbbchcpjihhgjhpfcnoan
* https://microsoftedge.microsoft.com/addons/detail/open-new-tab-after-curren/deebimacbjlpdcfbpacpckoccjnojacb
** https://github.com/ArnaudLigny/Open-New-Tab-After-Current-Tab
** https://dev.ligny.org/Open-New-Tab-After-Current-Tab
** https://arnaudligny.fr
** https://github.com/ArnaudLigny
* https://www.reddit.com/r/MicrosoftEdge/comments/juclzo/how_to_open_new_tabs_after_current
----
The Code
Error: File not found: gh>https://github.com/AzureCloudMonk/Open-New-Tab-After-Current-Tab-As-God-Intended-It-/blob/master/src/background.js
https://github.com/ArnaudLigny/Open-New-Tab-After-Current-Tab/blob/master/src/background.js
This code is part of a Chrome extension designed to manage the placement of new tabs. It aims to position new tabs right after the currently active tab, even as tabs are moved around or closed.
**Core Functionality**
* `currentIndex`: An array to keep track of the currently active tab's index in each window.
* `currentGroup`: A variable to store the group ID of the active tab, or -1 if it's ungrouped.
* `moveIt(tab, event)`: This function moves a given `tab` to the position right after the currently active tab in its window.
* `eventOnMoved`: This function updates `currentIndex` and `currentGroup` whenever a tab is moved.
* `getCurrentActiveTab()`: Gets the current active tab's position and group and stores them.
**Event Listeners**
* `chrome.tabs.onCreated`: When a new tab is created, move it after the current tab.
* `chrome.runtime.onInstalled`: When the extension is installed or updated, get the current active tab's information.
* `chrome.windows.onFocusChanged`: When the focus changes to a different window, update `currentIndex` and `currentGroup` for that window.
* `chrome.tabs.onActivated`: When a tab is activated, update `currentIndex` and `currentGroup`.
* `chrome.tabs.onMoved`: When a tab is moved, update `currentIndex` and `currentGroup`.
* `chrome.tabs.onRemoved`: When a tab is removed, update `currentIndex` and `currentGroup`.
**Key Points**
* The code uses `setTimeout` in some event listeners to ensure that the tab information is updated correctly, especially when dealing with focus changes or tab removals.
* There's a workaround to handle a scrollable tab strip issue in Chrome and Edge.
* The code includes extensive console logging to aid in debugging and understanding the extension's behavior.
**In Summary**
This Chrome extension code provides a way to automatically place new tabs after the current active tab, maintaining this behavior even as tabs are moved or closed. It uses event listeners to track changes in the browser's state and adjust the tab placement accordingly.
Web Browsers: Browser Networking, Brave Browser, Browser Tabs - OneTab - Open New Tab After Current Tab, Browser, Firefox, Microsoft Edge (Uninstall Microsoft Edge via Windows 11 / Windows 10 Debloat by Chris Titus - WinUtil), Chrome, Chromium, Vivaldi Browser, Opera, Safari. Browser Extensions - Browser Plugins, Browser Developer Tools, Vertical Tabs, Browser Troubleshooting (Browser Cache, Waiting for Cache), Browser Security, Browser Exploits. (navbar_browsers - see also navbar_firefox, navbar_chrome, navbar_brave, navbar_edge, navbar_wasm, navbar_browser_networking, navbar_advertising)
----
Cloud Monk is Retired (impermanence | for now). Buddha with you. Copyright | © Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.
----