reverted: --- b/core/core.services.yml +++ a/core/core.services.yml @@ -736,11 +736,6 @@ arguments: ['@title_resolver'] tags: - { name: render.main_content_renderer, format: drupal_modal } - main_content_renderer.iframeupload: - class: Drupal\Core\Render\MainContent\AjaxRenderer - arguments: ['@title_resolver'] - tags: - - { name: render.main_content_renderer, format: iframeupload } controller.form: class: Drupal\Core\Controller\HtmlFormController arguments: ['@controller_resolver', '@form_builder', '@class_resolver'] diff -u b/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php --- b/core/lib/Drupal/Core/Ajax/AjaxResponse.php +++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php @@ -79,16 +79,29 @@ $this->setData($this->ajaxRender($request)); } - // Add proper HTTP Header for IE. + // IE 9 does not support XHR 2 (http://caniuse.com/#feat=xhr2), so + // for that browser, jquery.form submits requests containing a file upload + // via an IFRAME rather than via XHR. Since the response is being sent to + // an IFRAME, it must be formatted as HTML. Specifically: + // - It must use the text/html content type or else the browser will + // present a download prompt. + // - It must place the JSON data into a textarea to prevent browser + // extensions such as Linkification and Skype's Browser Highlighter + // from applying HTML transformations such as URL or phone number to + // link conversions on the data values. + // + // Since this affects the format of the output, it could be argued that + // this should be implemented as a separate Accept MIME type. However, + // that would require separate variants for each type of AJAX request + // (e.g., drupal-ajax, drupal-dialog, drupal-modal), so for expediency, + // this browser workaround is implemented via a GET or POST parameter. + // + // @see http://malsup.com/jquery/form/#file-upload + // @see https://drupal.org/node/1009382 + // @see https://drupal.org/node/2339491 + // @see Drupal.ajax.prototype.beforeSend() if ($request->get('ajax_iframe_upload', FALSE)) { $this->headers->set('Content-Type', 'text/html; charset=utf-8'); - - // Browser IFRAMEs expect HTML. Browser extensions, such as Linkification - // and Skype's Browser Highlighter, convert URLs, phone numbers, etc. into - // links. This corrupts the JSON response. Protect the integrity of the - // JSON data by making it the value of a textarea. - // @see http://malsup.com/jquery/form/#file-upload - // @see http://drupal.org/node/1009382 $this->setContent(''); } } reverted: --- b/core/lib/Drupal/Core/Ajax/AjaxSubscriber.php +++ a/core/lib/Drupal/Core/Ajax/AjaxSubscriber.php @@ -27,7 +27,6 @@ $request->setFormat('drupal_ajax', 'application/vnd.drupal-ajax'); $request->setFormat('drupal_dialog', 'application/vnd.drupal-dialog'); $request->setFormat('drupal_modal', 'application/vnd.drupal-modal'); - $request->setFormat('iframeupload', 'application/vnd.drupal-ie-lte-9-sucks-beyond-compare'); } /** diff -u b/core/lib/Drupal/Core/ContentNegotiation.php b/core/lib/Drupal/Core/ContentNegotiation.php --- b/core/lib/Drupal/Core/ContentNegotiation.php +++ b/core/lib/Drupal/Core/ContentNegotiation.php @@ -33,7 +33,7 @@ // Check all formats, if priority format is found return it. $first_found_format = FALSE; - $priority = array('html', 'drupal_ajax', 'drupal_modal', 'drupal_dialog', 'iframeupload'); + $priority = array('html', 'drupal_ajax', 'drupal_modal', 'drupal_dialog'); foreach ($request->getAcceptableContentTypes() as $mime_type) { $format = $request->getFormat($mime_type); if (in_array($format, $priority, TRUE)) { reverted: --- b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php +++ a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php @@ -209,7 +209,7 @@ // These are all JSON errors for our purposes. Any special handling for // them can/should happen in earlier listeners if desired. + if (in_array($format, ['drupal_modal', 'drupal_dialog', 'drupal_ajax'])) { - if (in_array($format, ['drupal_modal', 'drupal_dialog', 'drupal_ajax', 'iframeupload'])) { $format = 'json'; }