@@ -648,7 +648,7 @@ const chatgpt = {
648648 const msgs = [ ] ; let isUserMsg = true
649649 chatDivs . forEach ( div => {
650650 const sender = isUserMsg ? 'USER' : 'CHATGPT' ; isUserMsg = ! isUserMsg
651- const msg = Array . from ( div . childNodes ) . map ( node => node . innerText )
651+ const msg = [ ... div . childNodes ] . map ( node => node . innerText )
652652 . join ( '\n\n' ) // insert double line breaks between paragraphs
653653 . replace ( 'Copy code' , '' )
654654 msgs . push ( `${ sender } : ${ msg } ` )
@@ -1498,7 +1498,7 @@ const chatgpt = {
14981498 // Process text node
14991499 if ( childNode . nodeType == Node . TEXT_NODE ) {
15001500 const text = childNode . nodeValue ,
1501- elems = Array . from ( text . matchAll ( reTags ) )
1501+ elems = [ ... text . matchAll ( reTags ] )
15021502
15031503 // Process 1st element to render
15041504 if ( elems . length > 0 ) {
@@ -1507,7 +1507,7 @@ const chatgpt = {
15071507 tagNode = document . createElement ( tagName ) ; tagNode . textContent = tagText
15081508
15091509 // Extract/set attributes
1510- const attrs = Array . from ( tagAttrs . matchAll ( reAttrs ) )
1510+ const attrs = [ ... tagAttrs . matchAll ( reAttrs ] )
15111511 attrs . forEach ( attr => {
15121512 const name = attr [ 1 ] , value = attr [ 2 ] . replace ( / [ ' " ] / g, '' )
15131513 tagNode . setAttribute ( name , value )
0 commit comments