Add message to 4chan Pass buyers.

This commit is contained in:
ccd0 2019-09-04 12:06:28 -07:00
parent ca58184cfe
commit f086c2ec52
5 changed files with 43 additions and 7 deletions

View File

@ -80,14 +80,10 @@
"*://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*"
],
"exclude_matches": [
"*://www.4chan.org/pass",
"*://www.4chan.org/pass?*",
"*://www.4chan.org/advertise",
"*://www.4chan.org/advertise?*",
"*://www.4chan.org/donate",
"*://www.4chan.org/donate?*",
"*://www.4channel.org/pass",
"*://www.4channel.org/pass?*",
"*://www.4channel.org/advertise",
"*://www.4channel.org/advertise?*",
"*://www.4channel.org/donate",

View File

@ -0,0 +1,11 @@
PassMessage =
init: ->
msg = $.el 'div',
className: 'box-outer top-box'
,
`<%= readHTML('PassMessage.html') %>`
$.ready ->
if (hd = $.id 'hd')
$.after hd, msg
else
$.prepend d.body, msg

View File

@ -0,0 +1,20 @@
<div class="box-inner">
<div class="boxbar"><h2>Trouble buying a 4chan Pass? (a message from 4chan X)</h2></div>
<div class="boxcontent">
<p>
You can buy solved CAPTCHAs at <%= meta.captchaServiceLinks.map(function(x) {return '<a href="' + x[1] + '" target="_blank" rel="noopener">' + x[0] + '</a>'}).join(', ') %>, and similar services.
They&#039;re a bit slow, but sufficient for image dumping.
Depending on how much you post, this can be cheaper than a Pass, and it doesn&#039;t require cryptocurrency to purchase.
4chan X has integrated support for services that use 2captcha&#039;s API.
Go to <b>Advanced &gt; Captcha Solving Service</b> in the settings panel to set it up.
</p>
<p>
If you&#039;re thinking of buying a Pass because of annoying &quot;Click verify once there are none left&quot; captchas, you may be able to get rid of them for free by checking <b>Force Noscript Captcha</b> in your settings.
</p>
<p>
Most imageboards either don&#039;t require captchas to post at all or require them only in limited circumstances.
Consider using another site.
4chan X works on many Tinyboard-based sites by default, and if your preferred site isn&#039;t on the default list, you can enable 4chan X on it by following <a href="<%= meta.faq %>#other-imageboards" target="_blank" rel="noopener">these instructions</a>.
</p>
</div>
</div>

View File

@ -79,7 +79,11 @@ Main =
Conf['Use Faster Image Host'] = 'true'
# Enforce JS whitelist
if /\.4chan(?:nel)?\.org$/.test(location.hostname) and !$$('script:not([src])', d).filter((s) -> /this\[/.test(s.textContent)).length
if (
/\.4chan(?:nel)?\.org$/.test(location.hostname) and
!SW.yotsuba.regexp.pass.test(location.href) and
!$$('script:not([src])', d).filter((s) -> /this\[/.test(s.textContent)).length
)
($.getSync or $.get) {'jsWhitelist': Conf['jsWhitelist']}, ({jsWhitelist}) ->
$.addCSP "script-src #{jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}"

View File

@ -100,6 +100,8 @@ SW.yotsuba =
///
quotelinkHTML:
/<a [^>]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g
pass:
/^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/
bgColoredEl: ->
$.el 'div', className: 'reply'
@ -130,8 +132,11 @@ SW.yotsuba =
initAuxiliary: ->
switch location.hostname
when 'www.4chan.org', 'www.4channel.org'
$.onExists doc, 'body', -> $.addStyle CSS.www
Captcha.replace.init()
if SW.yotsuba.regexp.pass.test(location.href)
PassMessage.init()
else
$.onExists doc, 'body', -> $.addStyle CSS.www
Captcha.replace.init()
return
when 'sys.4chan.org', 'sys.4channel.org'
pathname = location.pathname.split /\/+/