3 ms·
The point is you can't accurately simulate typing without something like Selenium. Neither the standard DOM API nor the additional features provided by the Web
by scottfr 9y ago
The point is you can't accurately simulate typing without something like Selenium. Neither the standard DOM API nor the additional features provided by the Web Extension API allow you to do so.
You can simulate some parts of typing by mimicking browser behavior on a case by case basis, but there are places where this will be strictly impossible. For example, if you are working with anything that checks the isTrusted event bit, you're out of luck as you there is no mechanism for you to set that to true.
Selenium on the other hand is actually triggering events as if a person physically triggered them. So, for instance, the isTrusted bit will be set to true when you use the send_keys method in Selenium.
- timwis 9y agoInteresting. Do you know how selenium does that?
- jarvuschris 9y agoLooks like it's a feature of the WebDriver API: https://www.w3.org/TR/webdriver/#element-interaction https://www.w3.org/TR/webdriver/#element-interaction