1function centerRecaptchaImageSelector() { 2 var userAgent = window.navigator.userAgent; 3 var isIe = userAgent.indexOf("MSIE ") > -1; 4 5 // closest doesn't work with IE. 6 if (isIe) { 7 return; 8 } 9 10 var allIframes = document.querySelectorAll('iframe'); 11 12 for (var i = 0; i < allIframes.length; i++) { 13 var currentIframe = allIframes[i]; 14 var recaptchaIframeDiv; 15 var recaptchaParentDiv; 16 17 // The only thing we have to identify the image selector is the iframe title. 18 var titleIsAcceptable = currentIframe.title && currentIframe.title.toLowerCase().indexOf("recaptcha") > -1; 19 20 if (titleIsAcceptable) { 21 recaptchaIframeDiv = currentIframe.closest('div'); 22 } 23 24 var isLogoIframe = true; 25 26 if (recaptchaIframeDiv) { 27 isLogoIframe = (' ' + recaptchaIframeDiv.className + ' ').indexOf(' ' + 'grecaptcha-logo' + ' ') > -1; 28 } 29 30 if (!isLogoIframe) { 31 recaptchaParentDiv = recaptchaIframeDiv.parentNode; 32 } 33 34 // Google might update its recaptcha-challenge-iframe title, and we can't center anymore. 35 if (recaptchaParentDiv) { 36 recaptchaParentDiv.style.position = null; 37 38 recaptchaIframeDiv.style.top = '50%'; 39 recaptchaIframeDiv.style.left = '50%'; 40 recaptchaIframeDiv.style.transform = 'translate(-50%, -50%)'; 41 recaptchaIframeDiv.style.right = null; 42 } 43 } 44} 45 46// This callback function is to add the ADA required label for the textarea generated out of Recaptcha. 47function recaptchaOnload() { 48 var name = 'g-recaptcha-response'; 49 var textArea = document.querySelector('[name="' + name + '"]'); 50 51 if (textArea && textArea.parentNode) { 52 var label = document.createElement('label'); 53 label.setAttribute('for', name); 54 label.innerText = name; 55 label.style.display = 'none'; 56 textArea.parentNode.insertBefore(label, textArea); 57 } 58}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.