A spellchecker provider for Electron, that encrypts your dictionary file.
npm install @standardnotes/electron-secure-spellchecker
A spellchecker provider for Electron, that encrypts your dictionary file.
Electron uses the built-in spellchecker from Chromium. It stores custom dictionary words on a plain-text file
named Custom dictionary.txt:
``txt`
worda
wordb
checksum_v1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This package reads all words from such file (if any exists) and then encrypts them using Electron's safeStorage. The plain-text file is then deleted and the encrypted file is used to read/write words going forward.
_Your Electron app must be using electron@15.3.0 or later._
To install, run:
`bash`
yarn add @standardnotes/electron-secure-spellchecker
Or:
`bash`
npm install @standardnotes/electron-secure-spellchecker
1. Import the package into your main file and call setup() and getInstance():
`javascript
import SecureSpellChecker from '@standardnotes/electron-secure-spellchecker';
...
SecureSpellChecker.setup();
...
const secureSpellChecker = SecureSpellChecker.getInstance();
`
1. Use secureSpellChecker.getSpellingSuggestions() to obtain misspelt word suggestions:
`javascript`
...
const suggestions = secureSpellChecker.getSpellingSuggestions('ytpo');
1. Import the package into your preload script and call setSpellCheckProvider()
`javascript
import SecureSpellChecker from '@standardnotes/electron-secure-spellchecker';
...
SecureSpellChecker.setSpellCheckProvider();
`
---
You can also see usage on the test app
Needs libxkbfile-dev. You can install it by running the following (Linux):
`bash`
sudo apt-get install libxkbfile-dev
1. Fork this repo
1. Create your feature branch: git checkout -b feat/my-featuregit add .
1. Code your feature
1. Add your changes: git commit -am 'feat: my feature'
1. Commit your changes: git push origin feat/my-feature`
1. Push the branch
1. Submit a pull request
See the LICENSE file for license rights and limitations (MIT).