diff --git a/node-edit-protection.js b/node-edit-protection.js
index e11c31e..0863bf9 100755
--- a/node-edit-protection.js
+++ b/node-edit-protection.js
@@ -33,6 +33,16 @@
 
 			// Handle backbutton, exit etc.
 			window.onbeforeunload = function() {
+				//Add CKEditor module support (http://drupal.org/project/ckeditor)
+				if (typeof(CKEDITOR) != 'undefined' && typeof(CKEDITOR.instances) != 'undefined') {
+					for (var i in CKEDITOR.instances) {
+						if (CKEDITOR.instances[i].checkDirty()) {
+							edit = true;
+							break;
+						}
+					}
+				}
+				
 				if (edit && !click) {
 					click = false;
 					return (Drupal.t("You will lose all unsaved work."));
diff --git a/node_edit_protection.module b/node_edit_protection.module
index 2a52c36..36b8566 100644
--- a/node_edit_protection.module
+++ b/node_edit_protection.module
@@ -4,7 +4,5 @@
  * Stops page from changing when user is posting.
  */
 function node_edit_protection_form_alter(&$form, &$form_state, $form_id) {
-  if(isset($form['#node_edit_form'])) {
-    drupal_add_js(drupal_get_path('module', 'node_edit_protection') . '/node-edit-protection.js');
-  }
+  drupal_add_js(drupal_get_path('module', 'node_edit_protection') . '/node-edit-protection.js');
 }
