diff --git a/lib/editor/dialog.js b/lib/editor/dialog.js
index <HASH>..<HASH> 100644
--- a/lib/editor/dialog.js
+++ b/lib/editor/dialog.js
@@ -61,7 +61,9 @@ Dialog._geckoOpenModal = function(url, action, init) {
     };
     capwin(window);
     // capture other frames
-    for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+    if(document.all) {
+        for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+    }
     // make up a function to be called when the Dialog ends.
     Dialog._return = function (val) {
         if (val && action) {
@@ -69,7 +71,9 @@ Dialog._geckoOpenModal = function(url, action, init) {
         }
         relwin(window);
         // capture other frames
-        for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+        if(document.all) {
+            for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+        }
         Dialog._modal = null;
     };
 };
Not so nice fix for "Not allowed to write to dialogs" on FireFox!