Skip to content

Commit

Permalink
whitelist the "hcaptcha.com" related origins, #312
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Jul 26, 2022
1 parent 57e8556 commit 82dc767
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/electron-main/web-request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ export function initWebRequestListenersByAccount(
);
return isStorageSubdomain ? [url.origin] : [];
})(),
...(() => {
// the iframe page generated by /core/v4/captcha?Token=... request at least loads the following stuff:
// - script: https://hcaptcha.com/1/api.js?onload=loadCaptcha&render=explicit
// - subFrame: https://newassets.hcaptcha.com/captcha/v1/335f764/static/hcaptcha.html
// - possibly https://accounts.hcaptcha.com
// so whitelisting it with subdomains
return url.origin === "https://hcaptcha.com" || url.origin.endsWith(".hcaptcha.com") ? [url.origin]: [];
})(),
].map(parseUrlOriginWithNullishCheck),
]);
};
Expand Down

0 comments on commit 82dc767

Please sign in to comment.