Auto-completes math equations while you type in input and textarea fields. When the current line ends with = (equals followed by two spaces), it evaluates the expression on that line and replaces it inline with a single space around = plus one trailing space, placing the caret after that space.
- Only capital
Xis accepted for multiplication (by design, due to formatting constraints). - Supports
+,-,*(viaX),/, parentheses, unary plus/minus, and%as a literal (e.g.,10%→0.1). - Detects mismatched parentheses and invalid expressions.
- Download or clone this folder locally.
- Open Chrome and go to
chrome://extensions. - Toggle on "Developer mode" (top-right).
- Click "Load unpacked" and select this project folder.
- The extension will appear in your extensions list.
- In any website with a text field (
inputortextarea), type an expression on a line such as:5 X 3 =→ becomes5 X 3 = 15 ␠(caret moves to the end, after one trailing space)-(2 + 3) =→ becomes-(2 + 3) = -5 ␠2 + (-3) =→ becomes2 + (-3) = -1 ␠
- Multiple expressions in a single line are supported. The extension evaluates only the segment after the last
=before the trigger and preserves earlier results. Example:- Type:
5 X 5 =→ becomes5 X 5 = 25 ␠ - Continue typing:
X 4 =on the same line → becomes5 X 5 = 25 X 4 = 100 ␠
- Type:
- Trigger condition: the line must end with
=(exactly two spaces after=). Other triggers are ignored by design.
manifest.json: Chrome Extension Manifest V3 configuration.background.js: Minimal background service worker (MV3), currently logs installation.content.js: The content script that performs inline evaluation.
- Multiplication: Only capital
Xworks (e.g.,5 X 3). Lowercasex,×, or*are not accepted as input; onlyXis recognized and internally mapped to*for evaluation. - Percentage semantics: Currently
10%is interpreted as0.1(a literal). If you want "percent of previous term" semantics (e.g.,50 + 10%→55), we can add that later. - Locales: No locale-specific number formatting.
- Targets: Works only on
inputandtextareafields (notcontenteditable). - Safety: Runs broadly on pages. If you need to restrict it, we can add host filters or input type checks.
- If nothing happens, ensure the line ends with
=(equals followed by two spaces) and that your caret is on that line. - If you see "Invalid expression", check for:
- Mismatched parentheses
- Disallowed characters
- Divide by zero
- If you’re testing on
file://pages, enable "Allow access to file URLs" for this extension inchrome://extensions.
- Edit
content.jsto adjust behavior. Reload the extension viachrome://extensions→ "Reload". - Open DevTools (F12) on any page, check the Console for logs/errors from the content script.
- Background logs appear in
chrome://extensions→ click "service worker" link under this extension.
MIT