Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Remove the SCAYT plugin from CKEditor - rely on the native browser spellchecker instead. #919

Open
klonos opened this issue Apr 3, 2020 · 0 comments

Comments

@klonos
Copy link

klonos commented Apr 3, 2020

https://github.com/govCMS/govCMS/blob/7.x-3.x/drupal-org.make#L229

The full version includes the https://ckeditor.com/cke4/addon/scayt plugin, which is proprietary, and requires a licence:

SCAYT is "installation-less", using the web services of WebSpellChecker.

Note: The out-of-the-box spell checking functionality is ad-supported. If you want to remove the ads, you can purchase a license here.

This is causing issues with the spell checking functionality not working, and we already had a couple of tickets re that raised in the GovCMS Service Desk queue.

I have tried the following:

  • Edit all WYSIWYG profiles that have CKEditor enabled, and disabled the "Check spelling" and "Check spelling as you type" buttons/plugins (both provided by SCAYT).
  • Cleared Drupal and browser caches.

The best that I could get out of it was to have spell checking work with a very noticeable delay (2-3 seconds). Sometimes even that does not work - the user needs to click outside the body field, because it seems that only when the field loses focus the spell checking works. Even then, the spell checker seems to be coming from SCAYT:

Screen Shot 2020-04-03 at 2 59 10 am

^^ again, this is with "Check spelling" and "Check spelling as you type" disabled, and caches cleared, for all WYSIWYG profiles:

Screen Shot 2020-04-03 at 3 11 22 am

Also see https://www.drupal.org/project/wysiwyg/issues/817894#comment-5368756

...thanks - your code from #4 worked great. FYI - the SCAYT buttons were all unchecked under the "Buttons and Plugins" area but I was still getting the scayt code everywhere.

I think that we should remove the SCAYT plugin altogether, since it is proprietary and seems to be behaving as an intrusive adware.

In Backdrop, we use a script that produces a customized version of CKEditor, with only the plugins that we need. See https://github.com/backdrop/backdrop/blob/1.x/core/misc/ckeditor/build-config.js

/**
 * This file was added automatically by CKEditor builder.
 * You may re-use it at any time to build CKEditor again.
 *
 * If you would like to build CKEditor online again
 * (for example to upgrade), visit one the following links:
 *
 * (1) https://ckeditor.com/cke4/builder
 *     Visit online builder to build CKEditor from scratch.
 *
 * (2) https://ckeditor.com/cke4/builder/52db0501b506570ee02f9e8a95a9d2a3
 *     Visit online builder to build CKEditor, starting with the same setup as before.
 *
 * (3) https://ckeditor.com/cke4/builder/download/52db0501b506570ee02f9e8a95a9d2a3
 *     Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
 *
 * NOTE:
 *    This file is not used by CKEditor, you may remove it.
 *    Changing this file will not change your CKEditor configuration.
 */

Alternatively, we can include a very simple, custom govcms_wysiwyg module, which only implements HOOK_wysiwyg_editor_settings_alter():

/**
* Implementation of hook_wysiwyg_editor_settings_alter().
*/
function govcms_wysiwyg_wysiwyg_editor_settings_alter(&$settings, $context) {
  if($context['profile']->editor == 'ckeditor') {
    $settings['scayt_autoStartup'] = FALSE;
    $settings['disableNativeSpellChecker'] = FALSE;
  }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant