Index: media-upload.js
===================================================================
--- media-upload.js	(revision 7858)
+++ media-upload.js	(working copy)
@@ -1,8 +1,7 @@
 // send html to the post editor
 function send_to_editor(h) {
-	var win = window.opener ? window.opener : window.dialogArguments;
-	if ( !win )
-		win = top;
+	var win = window.dialogArguments || opener || parent || top;
+
 	tinyMCE = win.tinyMCE;
 	if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) {
 		tinyMCE.selectedInstance.getWin().focus();
