A Chrome extension that automatically converts imperial measurements to metric units in web pages.
- Install dependencies:
npm install- Run tests:
npm test- Development with watch mode:
npm run test:watch- Lint and format code:
npm run lint
npm run format- Build extension:
npm run build- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the extension directory
This extension can also be installed on Safari for macOS using Apple's developer tools. Follow these steps to install and test the extension in Safari developer mode:
- macOS 10.14.6 (Mojave) or later
- Safari 14 or later
- Xcode 12 or later (available on the Mac App Store)
- Apple Developer account (free account is sufficient for development)
-
Run the build command to generate both Chrome and Safari extensions:
npm run build -
This will create a Safari extension project in the
dist/safaridirectory.
-
Open the Xcode project that was generated:
open dist/safari/Metric\ Imperial\ Converter/Metric\ Imperial\ Converter.xcodeproj -
In Xcode, select your Mac as the target device from the dropdown next to the Run button.
-
Click the Run button (
▶️ ) to build and run the app. -
A new app named "Metric Imperial Converter" will be installed and launched on your Mac.
-
The app itself is just a container and may show minimal UI. This is normal.
-
Open Safari.
-
Go to Safari > Settings... > Extensions.
-
You should see "Metric Imperial Converter" in the list of extensions.
-
Check the checkbox next to it to enable the extension.
-
You may need to grant permissions for the extension to access websites.
-
If the extension doesn't appear in Safari:
- Make sure the app is running
- Restart Safari
- Check Console.app for any error messages
-
If you make changes to the extension code:
- Stop the app in Xcode
- Run
npm run build:safariagain - Run the app in Xcode again
- The changes should be reflected in Safari
-
If Safari shows "Extension Manifest Not Found" error:
- Make sure your
manifest.jsonis valid - Try rebuilding the extension with
npm run build:safari
- Make sure your
-
In Safari, enable the Develop menu by going to Safari > Settings... > Advanced and checking "Show Develop menu in menu bar".
-
With the extension enabled and the website loaded, go to Develop > Web Extension Background Pages > Metric Imperial Converter.
-
This will open the Web Inspector for your extension, allowing you to view console logs and debug your extension.
- Converts imperial measurements to metric in real-time
- Supports inches (including fractions) and feet
- Works with dynamic content
- No network permissions required - all conversions happen locally
The project uses Jest for testing. Run tests with:
npm test- Run all testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Generate coverage report