Please note that CKEditor 4 reached its End of Life (EOL) in June 2023. From then on, it receives no more updates, new features, bug fixes, and most importantly, security patches.
If you have an active CKEditor 4 subscription and need help, you can contact our support team. If you are not ready to migrate yet, for a limited time we are offering a paid Extended Support Model that will protect you against security vulnerabilities and/or breaking third-party API changes.
You can use localStorage and/or onbeforeunload to prevent users from losing content when they mistakenly close the browser tab.