Bug: on Firefox the mouse wheel doesn't work if the mouse cursor is on a youtube embedded video
See original GitHub issueI explained the problem here http://stackoverflow.com/questions/19316625/firefox-scrolling-iframe-that-contains-embed-youtube-video .
The demo is here http://plnkr.co/edit/VHgjplC9o57b0rickPZt?p=preview (open it with Firefox).
Try the demo, scroll inside the iframe in the page.
I report the explained problem from stackoverflow: **************** from http://stackoverflow.com/questions/19316625/firefox-scrolling-iframe-that-contains-embed-youtube-video
` Scenario
My page p1 contains an iframe. The iframe points to a page p2 containing an embedded video from youtube.
Problem
The problem is that if I scroll (by mouse) the page inside the iframe, it scrolls normally only if the mouse cursor isn’t on a youtube embdedded video.
But if the mouse cursor is on a youtube embedded video, the page p2 inside the iframe stops to scroll, while the external page p1 starts to scroll.
How can avoid this no normal behaviour?
I expect that even if the mouse cursor is on the youtube embedded video, the page inside the iframe continues to scroll normally, and it doesn’t loose the mousewheel event.
Failed solutions
I tried to add the attribute wmode=“transparent” to the iframe tag of youtube embedded video, but it doesn’t solve the problem.
Details
To scroll inside the iframe I’m using a plugin that substitues the scrollbar.
Demo
You can find the demo here. Open it with Firefox and scroll with the mouse inside the iframe
`
Issue Analytics
- State:
- Created 10 years ago
- Comments:11 (5 by maintainers)
Top GitHub Comments
Because the browser handles its native scrollbar internally as an application. The custom scrollbar (like all custom scrollbars) is based on javascript (dragging it, using the mouse-wheel etc. are all based on javascript events) and javascript events are not allowed/triggered over iframes that host content that is on a different domain. This is a browser limitation which is there for security.
In short, the issue is that javascript events are not allowed over cross-domain iframes (it doesn’t matter if it’s a custom scrollbar or another plugin).
This happens only on cross-domain iframes. If you had an iframe that hosted a page from the same domain, e.g. another page on your site (like this example) everything would work.
Can we re-open this? It seems to me this exact bug is now back, on Chrome and on Firefox (and also on mobile device)