I am using latest Full CKEditor (4.5.3) with Office2013 style enabled.
I added filebrowserImageUploadUrl option here:
CKEDITOR.replace(
As it was guessed by @Wiktor the issue was in setting proper headers. I was almost there, setting wrong headers.
Right headers are obviously: "text/html" (not "plain/text", it recognizes it just as a text in this case)
$uploadResponse = new Response();
$uploadResponse->headers->set('Content-type', 'text/html');
$content = "<script type=\"text/javascript\">\n";
$content .= "window.parent.CKEDITOR.tools.callFunction(" . $funcNum . ", '/uploads/news_image/" . $response['uploadedName'] . "', '');\n";
$content .= "</script>";
$uploadResponse->setContent($content);