From 6381ae463b899caaf5b4197c057c7ddc850b8260 Mon Sep 17 00:00:00 2001 From: Tuxedo Takodachi Date: Sat, 18 Mar 2023 10:17:16 +0100 Subject: [PATCH] Port: Disable Javascript Whitelist on captcha iframe. #3292 from 2a8bf2adb0737ce7bb1e21f6b959e4c6e1de1bc7 --- src/main/Main.js | 1 + src/site/SW.yotsuba.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/Main.js b/src/main/Main.js index 329052798..74004a252 100644 --- a/src/main/Main.js +++ b/src/main/Main.js @@ -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()}`)); diff --git a/src/site/SW.yotsuba.tsx b/src/site/SW.yotsuba.tsx index 1331b5a22..a1475aa1c 100644 --- a/src/site/SW.yotsuba.tsx +++ b/src/site/SW.yotsuba.tsx @@ -139,7 +139,9 @@ $\ quotelinkHTML: /]*\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() {