A proof-of-concept Google Chrome webextension that works with standard <textarea>
HTML elements and uses the Divvun API to detect errors.
- Checkout this repo
- Install dependencies with
npm install
- Build the extension with
npm run build
. This will generate adist
folder - Open Google Chrome and follow these instructions to enable an unpacked extension, navigating to the newly-generated
dist
folder - Navigate to one of the below testing websites and enter some text. Your grammar will be checked as you type, and errors will appear underlined in red. Clicking an underlined word will show you suggestions to help improve your writing.
This repo also shows it is possible to integrate Rust-based web assembly (rust-wasm) for high-performance upgrades in the future. For now, this integration works by implementing an add()
function in Rust, which is compiled to wasm and called by the web extension to add two numbers. To see its output, navigate to one of the test sites (aside from github, which doesn't allow wasm), and open Chrome's browser console. There you will see the output of the add()
function.
In the future, Rust-wasm can be used to optimize the grammar checker as required.
Sites that can be used to test:
- https://github.com
- https://pastebin.com/
- https://borealium.org/en/resource/voice-se-female/
- https://news.ycombinator.com/
- https://preview.colorlib.com/theme/bootstrap/contact-form-16/
Sites known to cause problems:
- https://stackoverflow.com/questions/ask
- https://www.chakra-ui.com/docs/components/textarea
- https://colorlib.com/etc/cf/ContactFrom_v19/index.html
- Implement message passing for wasm calls on sites that don't allow wasm such as github.com (see this)
- Implement support for
input
and other non-textarea input boxes.