Require appropriate src attribute on all captcha-related iframes. #2531
This commit is contained in:
parent
a861c7a5b8
commit
9e8ebbba4e
@ -8,9 +8,9 @@ Captcha.replace =
|
|||||||
|
|
||||||
if Conf['captchaLanguage'].trim() or Conf['Captcha Fixes']
|
if Conf['captchaLanguage'].trim() or Conf['Captcha Fixes']
|
||||||
if location.hostname in ['boards.4chan.org', 'boards.4channel.org']
|
if location.hostname in ['boards.4chan.org', 'boards.4channel.org']
|
||||||
$.onExists doc, '#captchaFormPart', (node) -> $.onExists node, 'iframe', Captcha.replace.iframe
|
$.onExists doc, '#captchaFormPart', (node) -> $.onExists node, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe
|
||||||
else
|
else
|
||||||
$.onExists doc, 'iframe', Captcha.replace.iframe
|
$.onExists doc, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe
|
||||||
|
|
||||||
noscript: ->
|
noscript: ->
|
||||||
return if not ((original = $ '#g-recaptcha') and (noscript = $ 'noscript', original.parentNode))
|
return if not ((original = $ '#g-recaptcha') and (noscript = $ 'noscript', original.parentNode))
|
||||||
@ -20,7 +20,7 @@ Captcha.replace =
|
|||||||
$.rm original
|
$.rm original
|
||||||
insert = ->
|
insert = ->
|
||||||
span.innerHTML = noscript.textContent
|
span.innerHTML = noscript.textContent
|
||||||
Captcha.replace.iframe $('iframe', span)
|
Captcha.replace.iframe $('iframe[src^="https://www.google.com/recaptcha/"]', span)
|
||||||
if (toggle = $ '#togglePostFormLink a, #form-link')
|
if (toggle = $ '#togglePostFormLink a, #form-link')
|
||||||
$.on toggle, 'click', insert
|
$.on toggle, 'click', insert
|
||||||
else
|
else
|
||||||
|
|||||||
@ -69,7 +69,7 @@ Captcha.v2 =
|
|||||||
if @nodes.container
|
if @nodes.container
|
||||||
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1226835
|
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1226835
|
||||||
$.queueTask =>
|
$.queueTask =>
|
||||||
if @nodes.container and d.activeElement is @nodes.counter and (iframe = $ 'iframe', @nodes.container)
|
if @nodes.container and d.activeElement is @nodes.counter and (iframe = $ 'iframe[src^="https://www.google.com/recaptcha/"]', @nodes.container)
|
||||||
iframe.focus()
|
iframe.focus()
|
||||||
QR.focus() # Event handler not fired in Firefox
|
QR.focus() # Event handler not fired in Firefox
|
||||||
return
|
return
|
||||||
@ -120,7 +120,7 @@ Captcha.v2 =
|
|||||||
afterSetup: (mutations) ->
|
afterSetup: (mutations) ->
|
||||||
for mutation in mutations
|
for mutation in mutations
|
||||||
for node in mutation.addedNodes
|
for node in mutation.addedNodes
|
||||||
@setupIFrame iframe if (iframe = $.x './descendant-or-self::iframe', node)
|
@setupIFrame iframe if (iframe = $.x './descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node)
|
||||||
@setupTextArea textarea if (textarea = $.x './descendant-or-self::textarea', node)
|
@setupTextArea textarea if (textarea = $.x './descendant-or-self::textarea', node)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user