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 88function showExamples ( ) {
99 chrome . storage . local . get ( [ 'showExamples' ] , ( result ) => {
1010 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' ;
1818 }
1919 }
2020 } ) ;
You can’t perform that action at this time.
0 commit comments