Is there a way to disable custom webkit scrollbars?

10

Is there an extension, custom user stylesheet, etc. that will disable or revert the customization of scrollbars in Webkit based browsers like Google Chrome? I like the plain, native scrollbars but I cannot seem to find a combination of CSS to make them come back once they have been styled by CSS.

TedMilker

Posted 2012-01-20T17:21:10.377

Reputation: 201

replicate the native scrollbar in css, then inject that stylesheet using a extension. – Sarim – 2014-10-07T07:28:01.850

The webkit-scrollbar occurrences can be found in chrome_child.dll in later versions. – None – 2014-01-25T17:29:18.313

Answers

4

Unfortunately, the CSS cannot be "disabled" or reverted once activated:

::-webkit-scrollbar cannot be simply overridden to get the default style, the only way to do it is to remove all ::-webkit-scrollbar rules from the code. At that point, scrollable areas have to be forced to redraw the scrollbars. To do that you either quickly add and remove display:none; from or do the same thing with overflow:hidden; on scrollable elements. The problem with the first one is that the page flashes white at every page load; the second one is resource-intensive as it would have to whether check any element on the page overflows—not ideal.

The link above is from a script that will remove the custom bars completely, leaving you with no scroll bar.

JonathanMumm

Posted 2012-01-20T17:21:10.377

Reputation: 205

If they are still scrollable areas, wouldn't it render a regular scrollbar? Embedded iframes get scrollbars, so I figured the same would be true for other things that overflow. I mean, I'd expect something like http://backbonejs.org/ with its #sidebar div.

– Ehtesh Choudhury – 2013-03-22T05:54:40.107

2

Open your web browser executable in a binary-clean text editor or hex editor, and replace all occurrences of "webkit-scrollbar" with some other junk like "webkit-scrollb4r". I just tried this with Chrome and it solves the problem.

R.. GitHub STOP HELPING ICE

Posted 2012-01-20T17:21:10.377

Reputation: 1 783

1This would invalidate any digital signatures of the chrome.exe build, fwiw - so you may get scary warnings every time you try to open Chrome. – Dai – 2017-06-22T01:01:41.290

2Is modifying a compiled executable really safe? Wouldn't it be better to download Chromium source, modify it and compile it? – Oriol – 2014-01-25T18:11:47.040

-2

// ==UserScript==
// @name         My Fancy Scrollbar Userscript
// @namespace    http://your.homepage/
// @version      0.1
// @description  enter something useful
// @author       You
// @match        http://*/*
// @grant        none
// ==/UserScript==

[].forEach.call(document.styleSheets, function(sheet) {
    for (var i = 0; i < sheet.rules.length; ++i) {
        var rule = sheet.rules[i];
        if (/::-webkit-scrollbar/.test(rule.selectorText)) {
            sheet.deleteRule(i--);
        }
    }
});

bumfo

Posted 2012-01-20T17:21:10.377

Reputation: 1