Port: Disable Javascript Whitelist on captcha iframe. #3292

from 2a8bf2adb0737ce7bb1e21f6b959e4c6e1de1bc7
This commit is contained in:
Tuxedo Takodachi 2023-03-18 10:17:16 +01:00
parent cae0fa5a0b
commit 6381ae463b
2 changed files with 4 additions and 1 deletions

View File

@ -207,6 +207,7 @@ var Main = {
if (
/\.4chan(?:nel)?\.org$/.test(location.hostname) &&
!SW.yotsuba.regexp.pass.test(location.href) &&
!SW.yotsuba.regexp.captcha.test(location.href) &&
!$$('script:not([src])', d).filter(s => /this\[/.test(s.textContent)).length
) {
($.getSync || $.get)({'jsWhitelist': Conf['jsWhitelist']}, ({jsWhitelist}) => $.addCSP(`script-src ${jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}`));

View File

@ -139,7 +139,9 @@ $\
quotelinkHTML:
/<a [^>]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g,
pass:
/^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/
/^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/,
captcha:
/^https?:\/\/sys\.4chan(?:nel)?\.org\/+captcha(?:$|[?#])/,
},
bgColoredEl() {