Web Crash Caused by Styles in Chrome

· 1 min read

What the bug is

When accessing the web page in Chrome, everything is normal, but the page crashes directly when the developer tools are opened. If the page is refreshed with the developer tools open, it crashes but usually loads and runs when the developer tools are closed.

https://i.imgur.com/FJtPLZ1.jpeg

Version: Chrome v130.0.6723.70. Version v129 usually works.

Code Analysis

Actual tests found that commenting out the following code resolves the issue:

::-ms-scrollbar { display: none; }

Solution

Directly switch to using:

scrollbar-width: 0;

To Reproduce

Visit the link below to reproduce the issue:

https://alanhe421.github.io/test-page/web-crash.html

Final Thoughts

This issue demonstrates how specific CSS properties can cause browser crashes, particularly in newer versions of Chrome. The ::-ms-scrollbar pseudo-element appears to conflict with Chrome’s developer tools in version 130+. Using the standard scrollbar-width: 0 property instead provides a more stable and cross-browser compatible solution for hiding scrollbars. Always test CSS properties across different browser versions to avoid such compatibility issues.