I'm using Firefox 16.0.2 on Mac OS X 10.6.8, including the NoScript 2.5.9 plugin. Sometimes when browsing, a web site will have an embedded map or the like within it, and when scrolling down the page with the mouse wheel, once the cursor is over the map the wheel switches to zooming in and out rather than scrolling. Even on a dedicated mapping site, I find it unintuitive that the scroll wheel does something other than scrolling, and I can't imagine a scenario where I'd want scripts to be able to hijack it.

Is there some way to prevent scripts from receiving the mouse wheel events? I'm assuming that there's just something obvious in about:config or the NoScript options that I'm missing. The analogous option for stopping scripts from getting right clicks is in Options / Content / Enable Javascript Advanced / Disable or replace context menus.

Thank you!

  • It would be done by the sites via JS, so you want to keep JS enabled for the page but disable only that part of the script that modifies wheel behaviour? Maybe a custom userscript for GreaseMonkey or similar could be written to override just those functions... – Karan Nov 1 '12 at 19:43
  • Yes, I want to disable the mouse wheel events from getting to the page's JS, much like there's an option to disable it getting the right-click events. – Peter Cooper Jr. Nov 1 '12 at 19:46
  • No in-built option AFAIK. Userscript might be the only solution, but would probably need to be customised per site/page. – Karan Nov 1 '12 at 19:53
  • Look for preventDefault(). According to Javascriptkit this combined with returnfalse is one method to cause this behavior. I'm a know-nothing when it comes to JS, but it seems reasonable to create a userscript that overrides this specific event. – Jonathan Garber Nov 1 '12 at 20:39
  • Never mind, that's not it. Firefox doesn't support onmousewheel. From what I gather it's instead DOMMouseScroll, which passes a detail property with an inverse value to onmousewheel. – Jonathan Garber Nov 1 '12 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.