9

I am facing a strange issue after google chrome update to Version 75.0.3770.80 (Official Build) (64-bit) yesterday.

I am using Laravel and if I am trying to create a task using Ajax then it's adding twice from Google Chrome only but If I am creating the same task in firefox or in another browser then its working fine with a single entry. This issue I am facing only after chrome update otherwise it was working fine before. Is there any change in this new version which can affect my functionality?

I tried to analyze the issue and I have found the following difference which is given in below images for chrome and firefox. globalTask request showing one canceled request in chrome but I think it's executing correctly at server side and add an entry in a database. Can anyone help me to fix the issue?

Chrome enter image description here

Firefox enter image description here

Codes

$.ajax({
    url: "/globalTask",
    type: "POST",
    headers: {
        'X-CSRF-Token': 'hgdhgsddshjfs214dsf4s56f',
    },
    async: false,
    data: data,
    success: function (response) {

    }
});
Rakesh Sojitra
  • 3,538
  • 2
  • 17
  • 34
  • Experiencing the same thing here with our website.. looking for solutions. – user984976 Jun 07 '19 at 08:57
  • How to roll back to an older version of chromium under Ubuntu 18.04 http://techtuxwords.blogspot.com/2019/07/chromium-7503770xx-does-submit-html.html – André Schild Jul 16 '19 at 14:53
  • will post as a comment and not a full answer, because is more general case - could be caused even when you dont have any forms on your page. This is somehow related to **empty HREF links** on your html. solved it for me. see: https://stackoverflow.com/a/29418950/5477548 – yoad w Jul 27 '19 at 07:31

4 Answers4

3

I think I've found that this is related to preventDefault... looks to me like Chrome 75 is terminating a formPost if made via JS if you don't do a preventDefault() on the original event.

user984976
  • 1,314
  • 1
  • 12
  • 21
2

check, if the submit button has the type "submit" or "button". If your ajax is submitting the form, then the html button should have the type "button", otherwise both is submitted. I think that has solved the problem for me.

kkovacs
  • 21
  • 1
1

I am also seeing this issue (two HTTP POSTs, one of which is 'canceled') in our site on any form submit. We're using ASP.NET MVC 5 with JQuery 1.11 and Bootstrap 3.0.3.

Updating JQuery to the latest version (3.4.1) resolved our issue. Looking at the Chrome Network trace in Chrome 74 the initiator would say 'Other', but then in Chrome 75 one of the requests will show 'Other' and the second will have a JScript trace that went to JQuery's trigger function.

Initially added this code snippet to our login page and it fixed the issue. The Network trace shows a single request, but it was the JQuery stack trace as the Initiator and not 'Other'. Not sure how this code "fixed" the problem, so I'd avoid it as a band-aid.

// Chrome 75 is having double submit problems. This change stops that behavior, but may be an issue in JQuery 1.x
$(document).on('submit', 'form', function () {
   var button = $(this).find('input[type="submit"]');
   button.attr('disabled', 'disabled');
});

Looks like Google may be investigating the issue: Chromium bug report

1

Check your Chrome Extensions. In my case, I got the problem fixed when I disabled "Safe Torrent Scanner" extension that comes with new Bit Torrent Web.