Révision 6b24a280
Ajouté par Assos Assos il y a presque 4 ans
drupal7/misc/ajax.js | ||
---|---|---|
198 | 198 |
type: 'POST' |
199 | 199 |
}; |
200 | 200 |
|
201 |
// For multipart forms (e.g., file uploads), jQuery Form targets the form |
|
202 |
// submission to an iframe instead of using an XHR object. The initial "src" |
|
203 |
// of the iframe, prior to the form submission, is set to options.iframeSrc. |
|
204 |
// "about:blank" is the semantically correct, standards-compliant, way to |
|
205 |
// initialize a blank iframe; however, some old IE versions (possibly only 6) |
|
206 |
// incorrectly report a mixed content warning when iframes with an |
|
207 |
// "about:blank" src are added to a parent document with an https:// origin. |
|
208 |
// jQuery Form works around this by defaulting to "javascript:false" instead, |
|
209 |
// but that breaks on Chrome 83, so here we force the semantically correct |
|
210 |
// behavior for all browsers except old IE. |
|
211 |
// @see https://www.drupal.org/project/drupal/issues/3143016 |
|
212 |
// @see https://github.com/jquery-form/form/blob/df9cb101b9c9c085c8d75ad980c7ff1cf62063a1/jquery.form.js#L68 |
|
213 |
// @see https://bugs.chromium.org/p/chromium/issues/detail?id=1084874 |
|
214 |
// @see https://html.spec.whatwg.org/multipage/browsers.html#creating-browsing-contexts |
|
215 |
// @see https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy |
|
216 |
if (navigator.userAgent.indexOf("MSIE") === -1) { |
|
217 |
ajax.options.iframeSrc = 'about:blank'; |
|
218 |
} |
|
219 |
|
|
201 | 220 |
// Bind the ajaxSubmit function to the element event. |
202 | 221 |
$(ajax.element).bind(element_settings.event, function (event) { |
203 | 222 |
if (!Drupal.settings.urlIsAjaxTrusted[ajax.url] && !Drupal.urlIsLocal(ajax.url)) { |
Formats disponibles : Unified diff
-a