A Chrome extension that closes tabs matching URL rules you define. Built for the junk pages that pile up on their own — the GCP auth_success tab left behind after gcloud auth login, OAuth callback pages, "you may now close this window" screens, and the rest.
Add a rule, and the next time a matching tab appears, it closes itself. Rules persist across sessions and sync across the Chrome browsers you're signed into.
It's an unpacked extension — no store, no build step.
- Unzip this folder somewhere permanent (don't delete it later; Chrome loads it from disk).
- Go to
chrome://extensions. - Turn on Developer mode (top right).
- Click Load unpacked and select the unzipped
auto-closefolder. - Pin it: click the puzzle-piece toolbar icon, then the pin next to Auto-Close.
Click the toolbar icon to open the panel.
- Add this page — grabs the current tab's URL, strips the query string, and pre-fills a rule. This is the one-click path: when you're sitting on the leftover
auth_successtab, open the panel and hit it. The rule saves and closes the tab you're on. - New rule — add a pattern by hand.
- The amber dot in the header is the armed indicator. Pulsing = on. Grey = off. The On/Off switch arms or disarms everything at once without deleting your rules.
- Each rule has its own on/off switch, an edit pencil, and a delete button, plus a running closed count so you can see which rules are actually earning their keep.
Pick a match type per rule:
- Starts with (default) — the URL begins with your text. Best for pages that append changing query strings, e.g.
https://cloud.google.com/sdk/auth_successmatches…/auth_success?code=abc123. - Exact — the URL equals your text, character for character.
- Contains — your text appears anywhere in the URL.
- Wildcard —
*stands in for anything, e.g.https://*.google.com/*/auth_success.
Before you save, the panel tells you exactly how many of your currently open tabs the rule would close, and flags it if a pattern is broad enough to be dangerous. Patterns broad enough to nuke everything (*, bare https://, etc.) are blocked.
There's an optional close delay in the footer if you'd rather glance at a page for half a second before it disappears. Default is Instant.
- Rules and settings →
chrome.storage.sync(small, syncs across your signed-in Chrome browsers). - Close counters →
chrome.storage.local(stays on the machine; these update on every close and would otherwise burn the sync write quota). - Backup & restore → the options page (
Backup & restorein the footer) exports rules to a JSON file and imports them back. It opens in a full tab because file pickers don't behave reliably inside a popup.
Permissions are deliberately minimal: tabs (to read tab URLs and close matching tabs) and storage (to remember your rules). No host permissions, so the install warning stays small. Nothing leaves your browser — there's no network code.
auto-close/
manifest.json MV3 manifest
background.js service worker — watches navigations, closes matches
match.js shared matching logic (background + popup use the same code)
popup.html/.css/.js the toolbar panel
options.html/.js backup & restore + rules overview
icons/ 16 / 32 / 48 / 128