What is @ckeditor/ckeditor5-watchdog?
@ckeditor/ckeditor5-watchdog is a package designed to enhance the stability and reliability of CKEditor 5 by providing mechanisms to monitor and automatically recover from editor crashes. It ensures that the editor remains operational even in the face of unexpected errors.
What are @ckeditor/ckeditor5-watchdog's main functionalities?
Editor Watchdog
The Editor Watchdog monitors a single CKEditor 5 instance and automatically restarts it in case of a crash. This ensures that the editor remains available to the user.
const { EditorWatchdog } = require('@ckeditor/ckeditor5-watchdog');
const ClassicEditor = require('@ckeditor/ckeditor5-editor-classic/src/classiceditor');
const watchdog = new EditorWatchdog(ClassicEditor);
watchdog.create(document.querySelector('#editor'), {
// Editor configuration.
}).catch(error => {
console.error('Error initializing the editor:', error);
});
Context Watchdog
The Context Watchdog monitors a CKEditor 5 context, which can include multiple editor instances. It ensures that all editors within the context are restarted in case of a crash, maintaining the overall stability of the editing environment.
const { ContextWatchdog } = require('@ckeditor/ckeditor5-watchdog');
const Context = require('@ckeditor/ckeditor5-core/src/context');
const watchdog = new ContextWatchdog(Context);
watchdog.create({
// Context configuration.
}).then(context => {
// Create editors within the context.
}).catch(error => {
console.error('Error initializing the context:', error);
});
Other packages similar to @ckeditor/ckeditor5-watchdog
react-error-boundary
react-error-boundary provides a reusable component for handling JavaScript errors in React components. It offers a way to catch errors in the component tree and display a fallback UI. While it is not specific to CKEditor, it serves a similar purpose of enhancing application stability by managing errors gracefully.
redux-saga
redux-saga is a library that aims to make application side effects (e.g., asynchronous actions) easier to manage, more efficient to execute, and better at handling failures. It provides mechanisms to handle errors and retries, which can be compared to the watchdog functionality in terms of ensuring application robustness.
raven-js
raven-js is the official browser JavaScript client for Sentry, a real-time crash reporting system. It captures and reports errors in web applications, providing insights into crashes and helping developers to fix issues. Similar to @ckeditor/ckeditor5-watchdog, it focuses on monitoring and recovering from errors.
43.1.1 (September 25, 2024)
We are happy to announce the release of CKEditor 5 v43.1.1.
During a recent internal audit, we identified a Cross-Site Scripting (XSS) vulnerability in the CKEditor 5 clipboard package (CVE-2024-45613
). This vulnerability could be triggered by a specific user action, leading to unauthorized JavaScript code execution, if the attacker managed to insert malicious content into the editor, which might happen with a very specific editor configuration.
This vulnerability affects only installations where the editor configuration meets the following criteria:
- The Block Toolbar plugin is enabled.
- One of the following plugins is also enabled:
You can read more details in the relevant security advisory and contact us if you have more questions.
Taking the occasion, we decided to introduce additional hardening to some parts of our codebase that introduce theoretical and unexploitable issues. Our security team confirmed that none of these issues were exploitable in a real scenario, however, we decided to fix them, in order to increase the overall security posture of our software.
Released packages
Check out the Versioning policy guide for more information.
<details>
<summary>Released packages (summary)</summary>
Other releases:
</details>