-
Notifications
You must be signed in to change notification settings - Fork 148
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
on user exit without complete throw error #192
base: master
Are you sure you want to change the base?
Conversation
check this plz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition the code comments I'm having trouble trying to understand exactly what this PR is attempting to solve.
I commented in #180 asking for a https://codesandbox.io/ example so we can see the issue. This can also help when validating changes because we can publish alpha versions from PRs to test.
Thank you for taking the time to open a PR. We want to help fix errors/bugs but need a little more detail about the issue.
if (!("MutationObserver" in window)) return original; | ||
return new Promise((resolve, reject) => { | ||
const frame = document | ||
.querySelector('iframe[src*="google.com/recaptcha/api2/bframe"]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 🤔 we should be cautious using a querySelector
reaching for a very specific recaptcha related src that could change at will by google.
observer.disconnect(); | ||
} | ||
}); | ||
observer.observe(frame, { attributes: true, attributeFilter: ["style"] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 it also appears that if frame
is null
, from an unfound querySelector
, the .observe
methods errors.
fix #180
When a user exits without complete the challenge throw error.