Skip to content
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

[BUG] webkit can disable mouse when evaluating specified JavaScript code #6477

Closed
zyscoder opened this issue May 10, 2021 · 1 comment
Closed

Comments

@zyscoder
Copy link

  • Version: playwright@1.10.0
  • Platform: Linux zys-lab204l 5.8.0-50-generic feat: playwright.downloadBrowser #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: webkit

What steps will reproduce the bug?

Run the following code with node.js, and then the mouse would be disabled and has no any action until killing the node.js process.

const { webkit } = require('playwright');

(async () => {
    const browser = await webkit.launch({headless: false});
    const context = await browser.newContext();
    const page = await context.newPage();
    await page.goto('http://www.stanford.edu/');
    const code = "document.all[78].ontouchstart = null;document.all[78].requestPointerLock();" 
    await page.evaluate(code);
})();
@zyscoder zyscoder changed the title Bug Report: webkit can disable mouse when evaluating specified JavaScript code [Bug] webkit can disable mouse when evaluating specified JavaScript code May 10, 2021
@zyscoder zyscoder changed the title [Bug] webkit can disable mouse when evaluating specified JavaScript code [BUG] webkit can disable mouse when evaluating specified JavaScript code May 10, 2021
@JoelEinbinder
Copy link
Contributor

I get that its somewhat unexpected, but this is actually working as intended. Running with headless: false has the browser doing everything browsers usually do, including locking your pointer sometimes.

If you want to avoid this, run headless: true or use xvfb-run node yourscript.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants