Skip to content

Commit

Permalink
port: Disable Javascript Whitelist on captcha iframe. ccd0#3292
Browse files Browse the repository at this point in the history
from 2a8bf2a
  • Loading branch information
TuxedoTako committed Mar 5, 2023
1 parent 9a1bc45 commit 60127be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The 4chan XT project is a migration of 4chan X from coffeescript to TypeScript/J
- [x] 86071184aa39b3585f06c1a4e2921c411ad8cf10 archived.moe adds /pw/ search, tokyochronos has hosting issues
- [x] 8a6392b1cf721ddfae6d8f4e3ec2566f15755370 add Eientei
- [x] 451a06f54b878ce433b0775858affefc71927fc7 alice.al domain change
- [ ] 2a8bf2adb0737ce7bb1e21f6b959e4c6e1de1bc7 Disable Javascript Whitelist on captcha iframe. #3292
- [x] 2a8bf2adb0737ce7bb1e21f6b959e4c6e1de1bc7 Disable Javascript Whitelist on captcha iframe. #3292
- [ ] e9c1529da7844a42a1b40458c2c77b77e23ca537 Make QR post more like original form post. #3330
- [ ] d16062a8fac5c092c34310c7704ac3980494b6ef Merge remote-tracking branch '4chenz/master'
- [ ] 8795b1c56dbdfb52a32ddb3ea80b549f0048dc7b Add Google Lens image search url
Expand Down
1 change: 1 addition & 0 deletions src/main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ const 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])').filter(s => /this\[/.test(s.textContent)).length
) {
($.getSync || $.get)({ 'jsWhitelist': Conf['jsWhitelist'] }, ({ jsWhitelist }) => $.addCSP(`script-src ${jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}`));
Expand Down
4 changes: 3 additions & 1 deletion src/site/SW.yotsuba.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 60127be

Please sign in to comment.