Skip to content

Commit

Permalink
Fixed bug in reCAPTCHA-confirmation.
Browse files Browse the repository at this point in the history
Fixes #231.
  • Loading branch information
kkapsner committed Aug 31, 2018
1 parent 6ca0239 commit 260746f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,21 @@
const reCaptchaEntry = "^https://www\\.google\\.com/recaptcha/api2/(?:b?frame|anchor).*$";
const {url: urlContainer} = settings.getContainers();
settings.on("protectWindow", function({newValue}){
const urlValue = urlContainer.get();
const matching = urlValue.filter(function(entry){
return entry.url = reCaptchaEntry;
});
if (
newValue &&
(
matching.length === 0 ||
matching[0].protectWindow
) &&
window.confirm(browser.i18n.getMessage("protectWindow_askReCaptchaException"))
){
settings.set("protectWindow", false, reCaptchaEntry);
if (newValue){
const urlValue = urlContainer.get();
const matching = urlValue.filter(function(entry){
return entry.url === reCaptchaEntry;
});
if (
newValue &&
(
matching.length === 0 ||
matching[0].protectWindow
) &&
window.confirm(browser.i18n.getMessage("protectWindow_askReCaptchaException"))
){
settings.set("protectWindow", false, reCaptchaEntry);
}
}
});
});
Expand Down

0 comments on commit 260746f

Please sign in to comment.