Remove remaining obsolete noscript captcha code.
This commit is contained in:
parent
43ae6354f3
commit
26e38c17b1
@ -2,7 +2,7 @@ Main =
|
|||||||
init: ->
|
init: ->
|
||||||
if location.hostname is 'www.google.com'
|
if location.hostname is 'www.google.com'
|
||||||
if location.pathname is '/recaptcha/api/fallback'
|
if location.pathname is '/recaptcha/api/fallback'
|
||||||
$.ready -> Captcha.noscript.initFrame()
|
$.ready -> Captcha.v2.initFrame()
|
||||||
$.get 'Captcha Fixes', true, ({'Captcha Fixes': enabled}) ->
|
$.get 'Captcha Fixes', true, ({'Captcha Fixes': enabled}) ->
|
||||||
if enabled
|
if enabled
|
||||||
$.ready -> Captcha.fixes.init()
|
$.ready -> Captcha.fixes.init()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
class Connection
|
class Connection
|
||||||
constructor: (@target, @origin, @cb) ->
|
constructor: (@target, @origin, @cb={}) ->
|
||||||
$.on window, 'message', @onMessage
|
$.on window, 'message', @onMessage
|
||||||
|
|
||||||
send: (data) =>
|
send: (data) =>
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
Captcha.noscript =
|
|
||||||
initFrame: ->
|
|
||||||
conn = new Connection window.parent, "#{location.protocol}//boards.4chan.org",
|
|
||||||
response: (response) ->
|
|
||||||
$.id('response').value = response
|
|
||||||
$('.fbc-challenge > form').submit()
|
|
||||||
conn.send
|
|
||||||
token: $('.fbc-verification-token > textarea')?.value
|
|
||||||
error: $('.fbc-error')?.textContent
|
|
||||||
return unless img = $ '.fbc-payload > img'
|
|
||||||
cb = ->
|
|
||||||
canvas = $.el 'canvas'
|
|
||||||
canvas.width = img.width
|
|
||||||
canvas.height = img.height
|
|
||||||
canvas.getContext('2d').drawImage(img, 0, 0)
|
|
||||||
conn.send {challenge: canvas.toDataURL()}
|
|
||||||
if img.complete
|
|
||||||
cb()
|
|
||||||
else
|
|
||||||
$.on img, 'load', cb
|
|
||||||
@ -29,6 +29,11 @@ Captcha.v2 =
|
|||||||
# XXX Greasemonkey 1.x workaround to gain access to GM_* functions.
|
# XXX Greasemonkey 1.x workaround to gain access to GM_* functions.
|
||||||
$.queueTask => @save false
|
$.queueTask => @save false
|
||||||
|
|
||||||
|
initFrame: ->
|
||||||
|
if token = $('.fbc-verification-token > textarea')?.value
|
||||||
|
conn = new Connection window.parent, "#{location.protocol}//boards.4chan.org"
|
||||||
|
conn.send {token}
|
||||||
|
|
||||||
shouldFocus: false
|
shouldFocus: false
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
postsCount: 0
|
postsCount: 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user