1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-03 20:16:33 +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 reCaptchaEntry = "^https://www\\.google\\.com/recaptcha/api2/(?:b?frame|anchor).*$";
const {url: urlContainer} = settings.getContainers(); const {url: urlContainer} = settings.getContainers();
settings.on("protectWindow", function({newValue}){ settings.on("protectWindow", function({newValue}){
const urlValue = urlContainer.get(); if (newValue){
const matching = urlValue.filter(function(entry){ const urlValue = urlContainer.get();
return entry.url = reCaptchaEntry; const matching = urlValue.filter(function(entry){
}); return entry.url === reCaptchaEntry;
if ( });
newValue && if (
( newValue &&
matching.length === 0 || (
matching[0].protectWindow matching.length === 0 ||
) && matching[0].protectWindow
window.confirm(browser.i18n.getMessage("protectWindow_askReCaptchaException")) ) &&
){ window.confirm(browser.i18n.getMessage("protectWindow_askReCaptchaException"))
settings.set("protectWindow", false, reCaptchaEntry); ){
settings.set("protectWindow", false, reCaptchaEntry);
}
} }
}); });
}); });