Skip to content

Commit 270fdcc

Browse files
committed
actually remove scrollbars
1 parent 5e37751 commit 270fdcc

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

observer/index.html

+9-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@
3636
></iframe>
3737
</div>
3838
<script>
39-
document.querySelectorAll(".terminal").forEach((terminal) => {
40-
const viewport =
41-
terminal.contentWindow.document.querySelector(".xterm-viewport");
42-
if (!viewport) return;
43-
viewport.style.overflow = "hidden";
39+
document.querySelectorAll(".terminal").forEach((terminalIFrame) => {
40+
terminalIFrame.addEventListener("load", () => {
41+
const styleSheet =
42+
terminalIFrame.contentWindow.document.styleSheets[0];
43+
styleSheet.insertRule(
44+
".xterm-viewport { overflow: hidden !important; }",
45+
styleSheet.cssRules.length
46+
);
47+
});
4448
});
4549
</script>
4650
</body>

0 commit comments

Comments
 (0)