Implement simple spellchecker
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
const electron = require('electron');
|
||||
const ipc = electron.ipcRenderer;
|
||||
const webFrame = electron.webFrame;
|
||||
const notification = require('../js/notification');
|
||||
|
||||
Reflect.deleteProperty(global.Buffer); // http://electron.atom.io/docs/tutorial/security/#buffer-global
|
||||
@@ -146,3 +147,11 @@ notification.override({
|
||||
ipc.sendToHost('onNotificationClick');
|
||||
}
|
||||
});
|
||||
|
||||
const spellCheckerLocale = ipc.sendSync('get-spellchecker-locale');
|
||||
webFrame.setSpellCheckProvider(spellCheckerLocale, false, {
|
||||
spellCheck(text) {
|
||||
const res = ipc.sendSync('checkspell', text);
|
||||
return res === null ? true : res;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user