Better humanization
Some ideas in no particular order:
Human like scrolling behavior when scrolling elements into view. Cursor points on the element it wants to scroll and scrolling is done via the mouse wheel, with some uncertainty (go down, go up, go down) stutter etc.
Move the mouse to random points sometimes, although now the mouse trajectory seems human like if it always moves from one action thing to another action thing it is suspicious. It needs a little ADHD.
Humans will also just park their cursor for a bit on a random part of the page.
Also when entering the "desired" element to click on, just wait a bit before clicking, maybe even go back outside the element before re-entering and then click.
Add a randomized delay between actions, e.g. wait between 1-4 seconds between filling form fields. We could even define what an action is and then make sure that we don't do more than x actions a minute. Do some bogus actions in between maybe.
For typing, add random delays between characters. Maybe even a more complex algo which takes the keyboard layout into account. Make some mistakes while typing, but correct them.
Actions like .focus should be done with a humanized mouse cursor. Same for selecting the value of a select element. This also applies to other things like there should always be a click before fill or type. (Or alternatively simultate the tab key to switch between fields sometimes)
Add tiny random delays between multiple clicks on the same element e.g. double click.
Occasional small mouse movement while "typing".
I can help with some of the low hanging fruit, I just would like some feedback on my ideas first. Did I accidentally request anything that's already implemented?
Basically what I want from humanize is to set it to true and then just write the most straight forward playwright code to achieve the goal, but when running it looks like a human did it. I don't want to think about clicks, delays, typing etc.
I would like to add two new parameters to the browser config min_action_delay and max_action_delay.
cool idea, how about a PR? 💯
Sure, I just would like some feedback from @daijro first.