File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,16 +47,13 @@ function getCodesList() : string[] {
4747 const regex = / (?: [ A - Z 0 - 9 * ! @ # $ % ^ & * ] - ? ) { 12 } (?: (?: [ A - Z 0 - 9 * ! @ # $ % ^ & * ] - ? ) { 4 } ) ? / g
4848 const codes : string [ ] = [ ]
4949
50- const messageElements = document . querySelectorAll ( "div[class^='message']" )
51- messageElements . forEach ( messageElement => {
52- const markupElement = messageElement . querySelector ( "div[class^='markup']" ) as HTMLElement
53- if ( markupElement ) {
54- const codeMatch = markupElement . innerText . toUpperCase ( ) . match ( regex )
55- if ( codeMatch ?. [ 0 ] ) {
56- const code = codeMatch [ 0 ] . replaceAll ( "-" , "" )
57- console . debug ( `Idle Code found: ${ code } ` )
58- codes . push ( code )
59- }
50+ const markupElements = document . querySelectorAll ( "div[class*='message'] div[class*='markup']" ) as NodeListOf < HTMLElement >
51+ markupElements . forEach ( markupElement => {
52+ const codeMatch = markupElement . innerText . toUpperCase ( ) . match ( regex )
53+ if ( codeMatch ?. [ 0 ] ) {
54+ const code = codeMatch [ 0 ] . replaceAll ( "-" , "" )
55+ console . debug ( `Idle Code found: ${ code } ` )
56+ codes . push ( code )
6057 }
6158 } )
6259
You can’t perform that action at this time.
0 commit comments