@@ -135,7 +135,7 @@ <h1>Customized Default UI</h1>
135135 let span = document . createElement ( "span" ) ;
136136 span . addEventListener ( "click" , camOptionSelected ) ;
137137 span . setAttribute ( "id" , camera . deviceId ) ;
138- span . innerText = camera . label ;
138+ span . textContent = camera . label ;
139139 if ( camera . deviceId === currentCamera . deviceId ) {
140140 document . getElementById ( "selector_input_camera" ) . value = camera . label ;
141141 span . classList . add ( "selected" ) ;
@@ -151,10 +151,10 @@ <h1>Customized Default UI</h1>
151151 const currentResolution = await scanner . getResolution ( ) ;
152152 const gotResolution = document . querySelector ( "#gotResolution span" ) ;
153153 const resOptions = document . querySelectorAll ( "#ul_options_resolution span" ) ;
154- gotResolution . innerText = 'got ' + currentResolution [ 0 ] + ' x ' + currentResolution [ 1 ] ;
154+ gotResolution . textContent = 'got ' + currentResolution [ 0 ] + ' x ' + currentResolution [ 1 ] ;
155155 gotResolution . id = currentResolution [ 0 ] + 'x' + currentResolution [ 1 ] ;
156156 gotResolution . classList . add ( "selected" ) ;
157- document . getElementById ( "selector_input_resolution" ) . value = gotResolution . innerText ;
157+ document . getElementById ( "selector_input_resolution" ) . value = gotResolution . textContent ;
158158 for ( let i = 0 ; i < resOptions . length ; i ++ ) {
159159 resOptions [ i ] . addEventListener ( "click" , resOptionSelected ) ;
160160 } ;
@@ -199,7 +199,7 @@ <h1>Customized Default UI</h1>
199199 const _currentCamera = await scanner . getCurrentCamera ( ) ;
200200 camOptions . forEach ( span => {
201201 if ( span . id === _currentCamera . deviceId ) {
202- document . getElementById ( "selector_input_camera" ) . value = span . innerText ;
202+ document . getElementById ( "selector_input_camera" ) . value = span . textContent ;
203203 span . classList . add ( "selected" ) ;
204204 } else {
205205 span . classList . remove ( "selected" ) ;
@@ -222,9 +222,9 @@ <h1>Customized Default UI</h1>
222222 const _currentResolution = await scanner . getResolution ( ) ;
223223 const gotResolution = document . querySelector ( "#gotResolution span" ) ;
224224 const resOptions = document . querySelectorAll ( "#ul_options_resolution span" ) ;
225- gotResolution . innerText = 'got ' + _currentResolution [ 0 ] + ' x ' + _currentResolution [ 1 ] ;
225+ gotResolution . textContent = 'got ' + _currentResolution [ 0 ] + ' x ' + _currentResolution [ 1 ] ;
226226 gotResolution . id = _currentResolution [ 0 ] + 'x' + _currentResolution [ 1 ] ;
227- document . getElementById ( "selector_input_resolution" ) . value = gotResolution . innerText ;
227+ document . getElementById ( "selector_input_resolution" ) . value = gotResolution . textContent ;
228228 toggleMaskView ( ) ;
229229 }
230230 // camera's styles mask show or not
0 commit comments