Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome 83 AJAX requests cancelled - block doesn't save correctly #8664

Merged
merged 4 commits into from Jun 3, 2020
Merged

Chrome 83 AJAX requests cancelled - block doesn't save correctly #8664

merged 4 commits into from Jun 3, 2020

Conversation

bikerdave
Copy link
Contributor

Been having issues using Concrete5 on Chrome 83 where upon block save a blank JS error box appears. Upon page refresh it's clear the block did save as changes are reflected.

I can see the AJAX request made but in the Chrome network tab it's status is labelled as "cancelled". I can see the server respond 200 hence how the data is being saved.

This issue did not happen in MAMP Pro for me but I did find it affected Concrete5.7 (Ubuntu 16.04 nginx apache2 PHP7.1) and Concrete5 v8 (Ubuntu 18.04 nginx apache2 7.3) on cloud servers.

Found this issue and a fix that worked here - essentially updating a small amount of code in jquery-form.js and similar files.

@KorvinSzanto
Copy link
Member

Nice, thanks for getting to the bottom of this! I looked into why jquery form used javascript:false for https and I couldn't find any reasoning at all. It has just always been that way since 2009!

I opened a PR to add your changes in the jquery-form repo here: jquery-form/form#572

@KorvinSzanto
Copy link
Member

KorvinSzanto commented May 24, 2020

Looks like this PR needs to change a bit to support IE browsers, see my PR linked in my previous comment.

Also the file that includes this in edit mode appears to be app.js

@bikerdave
Copy link
Contributor Author

Thanks for the updates @KorvinSzanto, I've amended the vendor version of jquery-form.js to reflect your changes.

Also updated the app.js bundle and minified jquery-form.js file.

@Kramerican
Copy link

Kramerican commented Jun 3, 2020

This PR modifies minified files directly - isn't that a big no-no?

Anyway, untill this gets officially merged, and if you deal with old C5 versions which may be untenable to upgrade, here is a crazy-as-balls shell script you can run to fix up most C5 versions.

This assumes your web root is /var/www/html and that you haven't got the concrete core updated so files are actually being loaded from your updates folder. Also tries to commit stuff to git before changing anything so you can roll back.

These js files are cached pretty hard, so you will need to clear cache in Chrome before seeing this take effect - if it works for you at all - no guarantees from here, just thought I'd post it in case it helps somebody else

#!/bin/bash

cd /var/www/html
git init
git add .
git commit -m "Before C5 Patch"

#minified variants
find /var/www/html/ -type f -name "app.js" -exec sed -i 's/iframeSrc:\/^https\/i\.test(window\.location\.href||\"\")?\"javascript:false\":\"about:blank\"}/iframeSrc:(\/(MSIE|Trident)\/\.test(navigator\.userAgent||\"\")\&\&\/^https\/i\.test(window\.location.href||\"\"))?\"javascript:false\":\"about:blank\"}/' {} \;

find /var/www/html/ -type f -name "jquery-form.js" -exec sed -i 's/iframeSrc:\/^https\/i\.test(window\.location\.href||\"\")?\"javascript:false\":\"about:blank\"}/iframeSrc:(\/(MSIE|Trident)\/\.test(navigator\.userAgent||\"\")\&\&\/^https\/i\.test(window\.location.href||\"\"))?\"javascript:false\":\"about:blank\"}/' {} \;


#Unminified variants
find /var/www/html/ -type f -name "jquery.form.js" -exec sed -i 's/iframeSrc: \/^https\/i\.test(window\.location\.href || \x27\x27) ? \x27javascript:false\x27 : \x27about:blank\x27/iframeSrc:(\/(MSIE|Trident)\/\.test(navigator\.userAgent||\"\")\&\&\/^https\/i\.test(window\.location.href||\"\"))?\"javascript:false\":\"about:blank\"}/' {} \;

find /var/www/html/ -type f -name "jquery-form.js" -exec sed -i 's/iframeSrc: \/^https\/i\.test(window\.location\.href || \x27\x27) ? \x27javascript:false\x27 : \x27about:blank\x27/iframeSrc:(\/(MSIE|Trident)\/\.test(navigator\.userAgent||\"\")\&\&\/^https\/i\.test(window\.location.href||\"\"))?\"javascript:false\":\"about:blank\"}/' {} \;

exit 0

@aembler aembler merged commit 19b299d into concretecms:develop Jun 3, 2020
@FortyNinjaFISH
Copy link

Latest Google Chrome update (v83.0.4103.97) appears to have solved this issue for me.

@deek87
Copy link
Contributor

deek87 commented Jun 4, 2020

Chromium patched this earlier this week and Version 83.0.4103.97 (anything greater than 83.0.4103.96) contains the patch
It was a bug regression, more details from the chromium team - https://bugs.chromium.org/p/chromium/issues/detail?id=1084874

@bikerdave bikerdave deleted the hotfix/jquery-form-chrome-83-bug branch January 11, 2021 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants