npm.io
0.0.8 • Published 7 years ago

@paulbennetjoshua/electron-spellchecker

Licence
MIT
Version
0.0.8
Deps
12
Size
58 kB
Vulns
0
Weekly
0
Stars
1

Please refer original readme.md for base documentation.


Changes done in this fork

  1. Modified attachToInput api, so that you can manually initialize spellcheck event listening over a target parent dom element. This was done so that a embedded iframe's document body can also be spellchecked (some richtext-editors still use iframe).

Code sample:

// ...
let iframeDocumentBody = null;

try {
  iframeDocumentBody = document.body.querySelectorAll("iframe")[0].contentWindow.document.body;
} catch (err) {}

if (iframeDocumentBody) {
  spellcheckHandler.attachToInput(null, {
    targetElement: iframeDocumentBody
  });
}
// ...

Keywords