1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-06-18 09:49:35 +02:00

Fixed bug in reCAPTCHA-confirmation.

Fixes #231.
This commit is contained in:
kkapsner 2018-08-31 19:37:57 +02:00
parent 6ca0239c53
commit 260746f944

View File

@ -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);
}
}
});
});