-
Notifications
You must be signed in to change notification settings - Fork 220
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
Ensure DOM is settled #225
Conversation
@gladyshcodes is attempting to deploy a commit to the Antiwork Team on Vercel. A member of the Team first needs to authorize it. |
@slavingia FYI Currently, implementing such functionality without Playwright (as we discussed in #217) will be challenging and time-consuming as Playwright has its own internal lifecycle events that it emits / consumes When trying to do this natively I receive: Failed to wait for stable DOM: page.evaluate: Error: Timed out after 1000ms waiting for the DOM to stabilize.
at eval (eval at evaluate (:234:30), <anonymous>:5:15) See how Playwright listens to events I think we could always start with Playwright and then deprecated it with |
Sounds good, we can keep playwright for now! |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Looks good! Can we add this method for Github and Mailosaur tool as well? @gladyshcodes |
I guess I will close this PR as many fundamental changes will be made to those files in upcoming PR for issue #227. FYI @slavingia @m2rads
Okay, will make sure it's used everywhere across the codebase |
Issue #217
Proposed change
Get rid of
setTimeout
brute forceWhy
Ineffective (see why in the issue)
Outcome / numbers:
Process that took as a 1s to perform now takes about 1-5 ms (that's how much it actually takes for DOMContentLoaded event to be emitted)
However, since the pages Shortest navigates through may experience DOM mutations even after the initial page load (e.g., when modals are opened), we continue to wait until all DOM mutations are completed using
MutationObserver