GET IT in the Chrome App Store
Git Well Soon is a Chrome extension (version 2.1.0.0) that automatically persists the 'Hide whitespace changes' setting when reviewing pull requests on GitHub and GitHub Enterprise instances.
The name is cheeky way of saying I hope GitHub will implement this feature themselves and make my extension obsolete, Git Well Soon!
- Automatic Whitespace Handling: Automatically adds the whitespace hiding query parameter (
w=1) to GitHub pull request URLs - Works with GitHub & GitHub Enterprise: Compatible with both public GitHub and private GitHub Enterprise instances
- User Preference Respect: Honors manual user toggles of the whitespace setting
- Seamless Integration: Works behind the scenes without requiring any user configuration
- Minimal Permissions: Uses only the necessary permissions to function, enhancing your privacy and security
When you navigate to a pull request page with the /files or /changes view on GitHub or GitHub Enterprise, the extension:
- Detects if you're on a GitHub pull request page
- Checks if the whitespace parameter is already set
- If not set, automatically adds
?w=1to hide whitespace changes - Respects manual changes to the whitespace setting by monitoring the checkbox
- Manifest: MV3
- Permissions:
- Required:
storage(enables saving your custom hosts inchrome.storage.syncunderextraHosts). - Optional host origins (requested at runtime when you add a host via the popup).
- Optional:
tabs(requested from the popup only if you enable it; used to prefill the input with the active tab’s host and to auto-reload the active tab after enabling Tabs or after add/remove of a host). No background/service worker and no scripting permission.
- Required:
- Content script scope: Runs on GitHub and, once granted, on your enterprise host(s) for PR files/changes, compare, commits, and commit pages. The logic is gated by an allowlist (
github.comand typical GitHub-like hosts by default; your custom hosts are matched fromextraHosts). - Popup behavior:
- Add/remove hosts; host list updates immediately; clear button always visible; input can prefill from the active tab if Tabs permission is granted.
- If the Chrome permission prompt closes the popup, the pending add is finalized upon reopening (no second click).
- Implementation notes:
listGrantedHostsenumerates granted origins and excludes built-in GitHub hosts and wildcard-only hostnames.scheduleReloadIfActiveMatchesreloads the active tab (when Tabs is granted) if the hostname matches the host that was just added/removed.
- Tests & Dev:
- All tests live in
test/; UI and library coverage added; e2e tests hardened for SPA navigation and offline scenarios. - Local dev site under
site/with a tiny serverscripts/dev-site.js. Start withnpm run start:siteand (optionally) tunnel viangrok http 8080.
- All tests live in
The extension was created in response to a GitHub community issue where users requested persistent whitespace settings: GitHub Community Discussion #5486.
Simply install the extension and browse GitHub pull requests as usual. The whitespace hiding is enabled by default and will be automatically applied to all pull request file views.
The extension targets some known GitHub Enterprise url patterns, but you can manually add your specific GitHub Enterprise url domain by:
- Click the extension’s toolbar icon to open the popup.
- Enable the required
Storagepermission, so the extension can save and manage your list of hosts. - Optionally, enable the
Tabspermission, so the extension can intelligently reload and auto-fill host names. Again, this is an optional permission to enable nice-to-have features. - Enter your host (for example:
https://github.company.com) and click Add. - Reload the target tab;
w=1will be applied on PR files/compare/commit(s) routes on that host.
You can test the extension end-to-end against a temporary HTTPS host using ngrok. This is useful to verify optional host permissions, popup behavior, and the content script on non-github.com domains.
Prereqs:
- ngrok installed and logged in (https://ngrok.com/download)
- Any simple static server (examples below use Node or Python). macOS/Linux are fine.
Steps:
- Run a static server on localhost:8080:
- Node (built-in):
npm run start:site(equivalent tonode scripts/dev-site.js -p 8080)
- Start an HTTPS tunnel
ngrok http 8080- Note the https URL shown, e.g.:
https://1234567890.ngrok-free.app
- Grant the host in the extension popup
- Open the popup, enter exactly the host shown by ngrok, e.g.
https://1234567890.ngrok-free.app, and click Add. - Accept the permission prompt. If the Chrome permission prompt closes the popup, just reopen it; the host will finalize automatically.
- If you enable Tabs permission, the current tab will auto-reload after granting.
- Navigate to the simulated PR files or changes URL
- Visit:
https://1234567890.ngrok-free.app/owner/repo/pull/123/filesorhttps://1234567890.ngrok-free.app/owner/repo/pull/123/changes - The extension should append
?w=1to the URL automatically.
What to verify:
- Adding/removing the host updates the popup list immediately (no manual refresh).
- With Tabs permission enabled, the active tab auto-reloads after add/remove.
- Storage permission off disables input and clears the list display; turning it back on restores the list.
Troubleshooting:
- If input doesn’t prefill with the current host, enable Tabs permission.
- If add appears to require a second click, just reopen the popup—pending adds are finalized automatically.
- Make sure you add the exact ngrok subdomain (no wildcards).
