Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate pinch zoom in Google Chrome?

I'm developing a pinch zoom feature for a mobile app written in javascript and I want to test this in Google Chrome with the mobile device emulation feature. But I cannot find a way to test a pinch gesture.

I tried everything I could find on the internet (pressing Shift and moving the mouse, pressing Alt and moving the mouse), but none of this worked. Is there even a "native" way in Google Chrome to simulate a pinch zoom gesture?

btw I'm using the MacOs version of Google Chrome version 59.0.3071.86

like image 620
Philip Claren Avatar asked Jun 09 '17 11:06

Philip Claren


People also ask

How do I simulate pinch zoom in Chrome?

Hold down Shift then click and move your mouse to emulate pinch zooming.

How do I emulate touch events in Chrome?

Click the cog icon to open up it's settings. Then switch to the Overrides tab. Make sure Enable is checked and then activate Emulate touch events. You're done.

How do you pinch zoom without a mouse pad?

I just went from a MacBook to an iMac, and this was a frustrating thing to figure out without a trackpad. Just hold down the option key and use one finger on your magic mouse moving up and down. This will "pinch zoom" as your MacBook with trackpad does.


2 Answers

Shift + mouse click & drag across the viewport

Works for me. Only problem is that the touchstart event will return 1 for originalEvent.touches

like image 184
vsync Avatar answered Sep 30 '22 17:09

vsync


On Chrome v.71.x.x, you can pinch zoom pressing 'Toggle Device toolbar' at dev tools and after hold SHIFT and click-drag your mouse.

like image 33
menepet Avatar answered Sep 30 '22 18:09

menepet