File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 8
8
function showExamples ( ) {
9
9
chrome . storage . local . get ( [ 'showExamples' ] , ( result ) => {
10
10
const showExamples = result . showExamples ;
11
-
12
- const examples = document . getElementsByClassName ( 'xFUwe' ) [ 0 ] ;
13
- if ( examples && examples . children ) {
14
- for ( const child of examples . children ) {
15
- // skip the first child since it is the title of the examples section
16
- if ( child === examples . children [ 0 ] ) continue ;
17
- child . style . display = showExamples ? 'block' : 'none' ;
11
+ let examples = document . getElementsByClassName ( 'xFUwe' ) [ 0 ] ;
12
+ if ( ! examples ) return ;
13
+ let preTags = examples . getElementsByTagName ( 'pre' ) ;
14
+ if ( preTags ) {
15
+ for ( let tag of preTags ) {
16
+ console . log ( tag ) ;
17
+ tag . style . display = showExamples ? 'block' : 'none' ;
18
18
}
19
19
}
20
20
} ) ;
You can’t perform that action at this time.
0 commit comments