TabCloser v3.3.0

TabCloser v3.3.0

An issue was opened for TabCloser around not being about to close Slack Enterprise Grid workspaces. The old regex pattern was able to handle regular Slack team subdomains while avoiding slack.com itself, developer documentation, and specific paths like /account and /apps to make managing workspace settings easier. Enterprise Grid workspaces use a slightly different URL structure, and the regex wasn’t accounting for it.

^https?://(?!(app.slack.com|slack.com|api.slack.com|./(customize|account|apps)(/|$)|./home(/|$)))[a-z0-9-]+.slack.com/.*$

Previous Regex Pattern

To fix this, I tweaked the regex to make "enterprise." optional within the subdomain. Here's the updated pattern:

^https?://(?!(app\\.slack\\.com|slack\\.com|api\\.slack\\.com|.*\\/(customize|account|apps)(\\/|$)|.*\\/home(\\/|$)))[a-z0-9-]+\\.(enterprise\\.)?slack\\.com/(?:.*|ssb/signin_redirect\\?.*$)

Updated Regex Pattern

Lessons Learned

Optional groups (()?) keep things clean

Instead of writing separate regex patterns for standard and Enterprise Grid workspaces, I made enterprise. optional, keeping the pattern concise and readable.

Edge cases will find you—not the other way around

The original regex worked great—until it didn’t. This isn’t the first time I’ve run into URL-related issues in TabCloser. A while back, Figma updated their URLs when they introduced Figma Slides, which also broke the ability to close Figma file tabs. When Zoom had their Zoom Workplace rebrand, it also broke the ability for TabCloser to close out Zoom tabs for some users when some of the URLs patterns were tweaked. Even though I try to leverage the most simplistic way to detect URL patterns, something will inevitably break—and that’s okay.

Community, community, community

No matter how much real-world data I test against, it's impossible to anticipate every edge case. I really appreciate users catching these gaps and helping me improve TabCloser (well all of my projects). So a shoutout to Zachary for flagging this issue!

Updates rolling out

The fix is rolling out to the Google Chrome Web Store, the Microsoft Edge Add-On Store, and the macOS App Store. You can also manually install the latest release from GitHub. Expect to see v3.3.0 rolling out over the next few weeks or so (some of the approvals can be a little slow).

Message Board