File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,23 @@ function getBackToDefaultScrollbars() {
12
12
var ruleSet = sheet . rules || sheet . cssRules ;
13
13
for ( var i = 0 ; i < ruleSet . length ; ++ i ) {
14
14
var rule = ruleSet [ i ] ;
15
- if ( / s c r o l l b a r / . test ( rule . selectorText ) ) {
15
+ if ( ! rule . selectorText ) {
16
+ continue ;
17
+ }
18
+ if ( rule . selectorText . indexOf ( "::-webkit-scrollbar" ) >= 0 ) {
16
19
console . log ( "deleting scrollbar css rule at" , sheet . href ) ;
20
+ console . debug ( "css rule deleted is" , rule ) ;
17
21
sheet . deleteRule ( i -- ) ;
22
+ } else if ( rule . selectorText . indexOf ( "scrollbar" ) >= 0 ) {
23
+ // Github has some classes that are called "scrollbar"
24
+ // that if we delete them will break the file edit page.
25
+ // So this section is an attempt to debug similar cases if
26
+ // they arise.
27
+ console . debug ( "fishy scrollbar selector rule, but not deleting" , rule ) ;
18
28
}
19
29
}
20
30
} catch ( e ) {
21
- console . warn ( "Can't read the css rules of: " + sheet . href , e ) ;
31
+ console . debug ( "Can't read the css rules of: " + sheet . href , e ) ;
22
32
failedSheets [ sheet . href ] = true ;
23
33
}
24
34
} ;
You can’t perform that action at this time.
0 commit comments