nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Feature: Prevent zoom on Window

Open panther7 opened this issue 7 years ago • 10 comments

Hello,

please, could you add feature for prevent zoom on nw.Window.get() object? Issue is Ctrl + Wheel from webview.

Thanks

Demo: test.zip

#feature-request

panther7 avatar Nov 08 '17 10:11 panther7

You can add in your package.json:

"chromium-args": "--disable-pinch"

gpetrov avatar Dec 22 '17 13:12 gpetrov

does not work properly

panther7 avatar Jan 17 '18 14:01 panther7

+1 Is there any workaround to prevent zooming window which contains webview on mouse wheel?

Virius avatar Mar 15 '18 09:03 Virius

The trick from @gpetrov works for me.

oallouch avatar Mar 15 '18 15:03 oallouch

@oallouch, which version of nw.js you use? We are using v0.26.6 and "--disable-pinch" has not effect

Virius avatar Mar 16 '18 08:03 Virius

I use the latest.

oallouch avatar Mar 16 '18 10:03 oallouch

The --disable-pinch solution isn't working...

{
  "name": "myapp",
  ...
  "chromium-args": "--disable-pinch",
  ...
}

~possibly related to #1060~ or maybe not, as --mixed-context works just fine.

Platform Version
OS macOS X 10.13.4
nwjs 0.31.1

I would also like to point out that the proper way to control this behaviour should be by including a meta tag in the document, like so:

<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <!-- Other stuff in HEAD -->
  </head>
   ...
</html>

ranaharoni avatar Jun 12 '18 22:06 ranaharoni

Still doesn't works, meta tag too...

panther7 avatar Aug 12 '21 15:08 panther7

Same thing is happening for me. Mac OS 10.14.6, NWjs v0.65.0. I've tried the meta tag, the chromium arg, and the preventDefault method from this issue.

zenzoa avatar Jun 14 '22 20:06 zenzoa

Happening on Linux too with a touchscreen monitor. Not a great look for a fullscreen kiosk app. I'd rather not resort to something drastic like disabling multitouch on the system entirely.

skylarmt avatar Oct 13 '23 05:10 skylarmt