-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
User input simulation produces incorrect mouse movement in scaled/HiDPI modes on macOS #71
Comments
I don't have access to macOS, could you test a change? Line 239 in e0f2cb5
Replace this line with: if (['windows', 'macos'].includes(os)) { Here is a guide for building: https://github.com/dessant/buster/wiki/Building-the-extension-on-Ubuntu If you don't have your env set up for building, I can share the built package. |
Here's the patched extension: https://www.dropbox.com/s/vozlkbkg3lh8y1c/buster_captcha_solver_for_humans-0.5.2-patch.zip?dl=0 Disable the currently installed extension, unpack the zip into a folder, visit chrome://extensions, turn on developer mode and install the unpacked extension by dropping the folder on the browser window. You'll also have the run the client installer again, because the unpacked extension has a different ID that needs to be whitelisted by the client app. |
I just built the extension with the change and now the mouse cursor moves differently but it's still not correct, i.e. not solving the captcha. |
Does it still move below the target, but closer? |
Yeah, exactly. It actually seems to move slightly differently every time, even hitting the button at times but then failing to complete the challenge. |
Sounds like the change is needed, but not enough. I'll prepare a page for you to test something. |
https://adaptable-trip.glitch.me/ This is the source: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html {
height: 100%;
}
body {
margin: 0;
height: 2000px;
}
#notice {
background-color: #f00;
width: 100px;
height: 100px;
margin: 100px;
}
</style>
</head>
<body>
<div id="notice"></div>
<script>
window.addEventListener('click', function(e) {
console.log(window.devicePixelRatio)
// requires multiplying by scaling type: yes/no
console.log('click:',
e.screenX, // os scale: yes, page zoom: no
e.screenY, // os scale: yes, page zoom: no
e.clientX, // os scale: yes, page zoom: yes
e.clientY // os scale: yes, page zoom: yes
)
console.log('window:',
window.screenX, // os scale: yes, page zoom: yes
window.screenY, // os scale: yes, page zoom: yes
)
const {left: x, top: y, width, height} = document.querySelector('#notice').getBoundingClientRect();
console.log('node:',
y, // os scale: yes, page zoom: yes
y, // os scale: yes, page zoom: yes
width, // os scale: yes, page zoom: yes
height // os scale: yes, page zoom: yes
)
})
</script>
</body>
</html> Perform these steps once with scaling set to 1, then to 2: Maximize the browser window and click the top left corner of the red square. Now move the mouse to the left and click while touching the edge of the screen. Please open the browser console and share the output. |
Here you go:
|
Thanks a lot, these appear to be expected values. I'm not sure where to go from here, are the clicks off only by a couple of pixels with the patch? |
It usually ends up around here: https://www.dropbox.com/s/hpf84mpmk71pnov/Screenshot%202019-05-05%2022.00.20.png?dl=0 So, yeah, pretty close. |
@deepfriedmind, as a workaround you could substract a couple of pixels from x and y in your local build. Alternatively, you could navigate to the extension button with the keyboard and press Enter to activate keyboard navigation, that way the bug will not be triggered. |
I won't be able to debug this without a device, if anyone would like to work on this issue, please let me know. |
I've ran into the same issue locally and after some debugging I've found the culprit. In After dividing the target element width/height by Edit: |
@menzow, that's a great find, thanks for the PR! I'm wondering if we should divide the width and height by |
@menzow, actually dividing by |
The fix has been published for Firefox, Chrome and Opera will likely take a couple of days to pass reviews. |
Just wanted to confirm that it works great now and to say thanks! |
System
Extension
Bug description
When I click the "Solve the challenge" button, the mouse cursor moves to the bottom of the screen and clicks. After this, nothing else happens until it throws the error in the console.
I have tried it in incognito mode with no other extensions enabled.
This happens when using either of the default resolutions.
window.devicePixelRatio
reports 2.If I use a 3rd party app to set the native resolution (pretty much unusable) the input simulation works.
Logs
Browser:
In
script.js
, it's this event listener:Client app:
The text was updated successfully, but these errors were encountered: