How do I stop scripts from accessing the mouse wheel in Firefox?

2

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!

user169501

Posted 2012-11-01T19:37:38.610

Reputation:

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 – 2012-11-01T19:43:46.360

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. – None – 2012-11-01T19:46:38.693

No in-built option AFAIK. Userscript might be the only solution, but would probably need to be customised per site/page. – Karan – 2012-11-01T19:53:55.487

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 – 2012-11-01T20:39:29.387

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 – 2012-11-01T20:47:47.137

Looks like the "bug" to implement this is at https://bugzilla.mozilla.org/show_bug.cgi?id=564021. Would be happy if there were some workaround or userscript or the like I could use in the meantime.

– None – 2012-11-21T01:44:22.710

No answers