JohnsonRan/6or4

Display the current page's IP version and addresses

★ 1Forks 0JavaScriptGitHub ↗Compare

README

6or4

6or4 is a Chrome extension that shows whether the current page was fetched over IPv6 or IPv4. Click the toolbar icon to see every domain that served the page, its server IP address, HTTPS status, request counts and timings.

6or4 is a fork of IPvFoo by Paul Marks, licensed under the Apache License 2.0. It targets Chrome Manifest V3 and the Chrome Web Store only, with a redesigned interface, in-popup settings and English/Simplified Chinese localization. See NOTICE.

Connection information is captured locally using the webRequest API, without creating any additional network traffic for passive capture.

Optional Geo lookups and privacy

Geo Info is disabled by default. If you enable it in Options, opening the popup or refreshing a Geo cell can send public server IP addresses to ip.sb and, when the primary service is slow or fails, ipwho.is. These services see the queried server IP and your public IP, which may reveal browsing activity. Page URLs and domain names are not included in Geo requests.

Results are cached locally by IPv4 /24 or IPv6 /48 prefix for up to 7 days (empty results for 10 minutes); expired entries are removed during periodic cleanup. The cache can include lookups from incognito windows when the extension is allowed there. Disabling Geo stops new lookups but does not erase existing cached data; use Clear Geo Cache to remove it.

Upgrades preserve an existing saved Geo setting, including an enabled setting. That setting is not proof of informed consent: review Options and the privacy policy before using Geo. Revert to Defaults disables Geo.

Screenshots

Screenshot

Upstream project

IPvFoo, the original extension, is available at https://github.com/pmarks-net/ipvfoo and on the Chrome Web Store. 6or4 is an independent fork and is not affiliated with or endorsed by the upstream author.

Running 6or4 unpacked from git

  1. Open chrome://extensions and enable Developer mode.
  2. Click Load unpacked and select this repository's src/ directory.

src/manifest.json is the only manifest source. No browser-switching step is needed.

Tests

Run node tests/non_ui_test.cjs (or make test). This dependency-free suite covers Geo privacy defaults, cache mutation/cleanup races, and the existing IP parser tests. It uses mocked browser APIs; real Chrome extension smoke testing is still required before publishing.

You can also open tests/iputil_test.html in Chrome to run the IP tests in a browser.

Chrome Web Store package

With GNU Make and Info-ZIP installed, run make (or make chrome). The ZIP is written to build/6or4-<version>.zip, with manifest.json at its root. Packaging never modifies src/manifest.json.

Alternatively, with Node and 7-Zip installed, run these commands from the repository root in Bash:

VERSION=$(node -p 'require("./src/manifest.json").version')
mkdir -p build
rm -f "build/6or4-${VERSION}.zip"
(cd src && 7z a -tzip -mx=9 "../build/6or4-${VERSION}.zip" .)

Store listing text, privacy answers and images are in misc/store/ (see misc/store/LISTING.md).

Before uploading, test the unpacked extension in Chrome and ensure the store listing's privacy disclosures and hosted privacy policy match PRIVACY.md. Existing enabled Geo preferences remain enabled on upgrade; resetting to defaults turns Geo off.

Icons

All PNG icons are rendered from SVG with the bundled Geist Mono font: the store icon from misc/brand/icon.svg, and the toolbar status icons (src/generated_icons/, one per IPv6/IPv4 pattern and toolbar color) from templates in misc/brand/render-icons.cjs. Chrome's action.setIcon() does not accept SVG, so the PNGs are committed. To regenerate them, install Playwright with Chromium and run node misc/brand/render-icons.cjs. Popup and settings icons are inline SVG in src/ui.css.

Fonts

The popup and options pages use Geist and Geist Mono (latin subsets, from @fontsource-variable), bundled in src/fonts/ and loaded from the extension itself; no fonts are fetched remotely. They are licensed under the SIL Open Font License 1.1; see src/fonts/OFL-*.txt.

Contributors

pmarks-netJohnsonRanGitoffthelawnhalf-duplex

Issues