Skip to content

Commit

Permalink
dont add the input listener if its not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder committed Feb 6, 2021
1 parent 19af93a commit 58a5f6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/supplements/showUserInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { ContextListener } from '../instrumentation';

export class ShowUserInput implements ContextListener {
async onContextCreated(context: BrowserContext) {
if (!context._browser.options.showUserInput)
return;
context._inputListeners.add(async (page, event) => {
if (!page.context()._browser.options.showUserInput)
return;
if (event.type === 'touchscreen.tap')
return showTapIndicator(page, event.x, event.y);
if (event.type === 'mouse.down' || event.type === 'mouse.move' || event.type === 'mouse.up')
Expand Down

0 comments on commit 58a5f6b

Please sign in to comment.