From b1c4c759f417d014067561bb069aa65b9c9a78c4 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 23 Dec 2016 14:35:40 +0000 Subject: [PATCH] blind fix for captcha on electron --- src/components/views/login/CaptchaForm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/login/CaptchaForm.js b/src/components/views/login/CaptchaForm.js index 0e5922f464..16012837a2 100644 --- a/src/components/views/login/CaptchaForm.js +++ b/src/components/views/login/CaptchaForm.js @@ -54,8 +54,9 @@ module.exports = React.createClass({ console.log("Loading recaptcha script..."); var scriptTag = document.createElement('script'); window.mx_on_recaptcha_loaded = () => {this._onCaptchaLoaded()}; + var protocol = global.location.protocol === "file:" ? "https:" : global.location.protocol; scriptTag.setAttribute( - 'src', global.location.protocol+"//www.google.com/recaptcha/api.js?onload=mx_on_recaptcha_loaded&render=explicit" + 'src', protocol+"//www.google.com/recaptcha/api.js?onload=mx_on_recaptcha_loaded&render=explicit" ); this.refs.recaptchaContainer.appendChild(scriptTag); }