New version of captcha when hiding bubble sets visibility to hidden and doesn't always go offscreen.
This commit is contained in:
parent
fbbfad75f8
commit
7ddefaf35a
@ -241,6 +241,7 @@ Captcha.v2 =
|
|||||||
fixBubble: (node) ->
|
fixBubble: (node) ->
|
||||||
{bottom, right, width} = node.getBoundingClientRect()
|
{bottom, right, width} = node.getBoundingClientRect()
|
||||||
if (
|
if (
|
||||||
|
getComputedStyle(node).visibility isnt 'hidden' and
|
||||||
bottom > 0 and # not deliberately offscreen
|
bottom > 0 and # not deliberately offscreen
|
||||||
right > doc.clientWidth # offscreen to right
|
right > doc.clientWidth # offscreen to right
|
||||||
)
|
)
|
||||||
|
|||||||
@ -154,7 +154,8 @@ QR =
|
|||||||
|
|
||||||
inBubble: ->
|
inBubble: ->
|
||||||
bubbles = $$ 'iframe[src^="https://www.google.com/recaptcha/api2/frame"]'
|
bubbles = $$ 'iframe[src^="https://www.google.com/recaptcha/api2/frame"]'
|
||||||
d.activeElement in bubbles or bubbles.some((el) -> el.getBoundingClientRect().bottom > 0)
|
d.activeElement in bubbles or bubbles.some (el) ->
|
||||||
|
getComputedStyle(el).visibility isnt 'hidden' and el.getBoundingClientRect().bottom > 0
|
||||||
|
|
||||||
inCaptcha: ->
|
inCaptcha: ->
|
||||||
(d.activeElement?.nodeName is 'IFRAME' and QR.nodes.el.contains(d.activeElement)) or (QR.hasFocus and QR.inBubble())
|
(d.activeElement?.nodeName is 'IFRAME' and QR.nodes.el.contains(d.activeElement)) or (QR.hasFocus and QR.inBubble())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user