Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 'Request bridge' in settings. #14914

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions browser/ui/webui/settings/brave_tor_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ constexpr const char kTorBridgesUrl[] =
constexpr const char16_t kGetCaptchaScript[] =
uR"js(
(function() {
const captchaBox = document.getElementById('captcha-box')
const captchaBox = document.getElementById('bridgedb-captcha')
if (!captchaBox) return null

const captchaImages = captchaBox.getElementsByTagName('img')
Expand All @@ -62,12 +62,12 @@ constexpr const char16_t kGetCaptchaScript[] =
constexpr const char16_t kSendCaptchaScript[] =
uR"js(
(function(captcha) {
const responseField = document.getElementById('captcha_response_field')
const responseField = document.getElementById('bridgedb-captcha-input')
if (!responseField) return null

responseField.value = captcha

const submit = document.getElementById('captcha-submit-button')
const submit = document.getElementById('bridgedb-captcha-submit')
if (!submit) return null

submit.click()
Expand All @@ -82,7 +82,8 @@ constexpr const char16_t kParseBridgesScript[] =
if (!bridgeLines) return null

const bridges = bridgeLines.textContent.split('\n').filter(
(bridge) => { return bridge.trim().length != 0 })
(bridge) => { return bridge.trim().length != 0 }).
map((brigde) => { return brigde.trim(); })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boocmp s/brigde/bridge, right?

return {bridges : bridges}
})();
)js";
Expand Down