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
FIX avoid javascript error when preview is https #5163
Conversation
When the admin interface is http but the preview is https, javascript isn't able to read the contentDocument of the secure preview iframe. This currently results in a javascript error. Patch wraps try/catches around the two instances,
Can we do some kind of I appreciate fixing this issue, but how is it coming about that the preview is secure but the CMS isn't? If the site is enforcing SSL (which is the only way I can imagine this is happening) then shouldn't the CMS be https too? I'll accept this PR with a |
We use static publishing in our installation. Once the page has been statically published its viewable on a static domain. CMS is on http://admin.www.example.com (internal access only) pages are statically published to https://www.example.com I'm not willing to have |
I think that if a user opens the browser console, they probably want to see this kind of thing (and until now they'd have seen exceptions that were thrown instead). Silently catching exceptions gives devs no way to figure out what is wrong and will make debugging more difficult. I don't think a noisy console for Admin users is a valid reason to deliberately stifle the use of a developer tool |
Currently if a user triggers this scenario the JS stops running and CMS becomes unusable until the page is reloaded. |
+1 on this. I think we need the console.warn in this case. If this is really an error condition, should it be console.error instead, though? |
I'm not too fussed about error vs warn. |
Build dist assets and added console.warn
merged by hand and added the |
Just wanted to point out that this affects older versions. Is there a particular reason this was done in |
…pting to access <iframe> contents (Back-porting fix from PR silverstripe#5163)
When the admin interface is http but the preview is https, javascript isn't able to read the contentDocument of the secure preview iframe. This currently results in a javascript error. Patch wraps try/catches around the two instances,