| <!DOCTYPE html> |
| <script> |
| if (window.internals) { |
| internals.runtimeFlags.overlayScrollbarsEnabled = true; |
| internals.settings.setMockScrollbarsEnabled(true); |
| } |
| </script> |
| <div id="div" style="overflow: scroll; width: 200px; height: 200px;"> |
| <div style="background-color: green; height: 3000px; width: 100px"></div> |
| </div> |
| <iframe srcdoc="<div style='background-color: red; height: 3000px; width: 100px'></div>" |
| id="iframe", |
| width="200", |
| height="200"></iframe> |
| <script> |
| window.onload = function() { |
| if (window.internals) { |
| internals.runtimeFlags.overlayScrollbarsEnabled = true; |
| |
| var div = document.querySelector('#div'); |
| var iframe = document.querySelector('#iframe'); |
| internals.setScrollbarVisibilityInScrollableArea(div, true); |
| internals.setScrollbarVisibilityInScrollableArea( |
| iframe.contentDocument, true); |
| |
| internals.setScrollbarVisibilityInScrollableArea(div, false); |
| internals.setScrollbarVisibilityInScrollableArea( |
| iframe.contentDocument, false); |
| } |
| } |
| </script> |