@@ -193,12 +193,12 @@ const chatgpt = {
193193 + '.chatgpt-modal .checkbox-group label {'
194194 + 'font-size: .7rem ; margin: -.04rem 0 0px .3rem ;'
195195 + `color: ${ scheme == 'dark' ? '#e1e1e1' : '#1e1e1e' } }`
196- + '.chatgpt-modal input[type=" checkbox" ] { transform: scale(0.7) ;'
196+ + '.chatgpt-modal input[type=checkbox] { transform: scale(0.7) ;'
197197 + `border: 1px solid ${ scheme == 'dark' ? 'white' : 'black' } }`
198- + '.chatgpt-modal input[type=" checkbox" ]:checked {'
198+ + '.chatgpt-modal input[type=checkbox]:checked {'
199199 + `border: 1px solid ${ scheme == 'dark' ? 'white' : 'black' } ;`
200200 + 'background-color: black ; position: inherit }'
201- + '.chatgpt-modal input[type=" checkbox" ]:focus { outline: none ; box-shadow: none }'
201+ + '.chatgpt-modal input[type=checkbox]:focus { outline: none ; box-shadow: none }'
202202 ) ;
203203 }
204204
@@ -455,7 +455,7 @@ const chatgpt = {
455455 async isIdle ( timeout = null ) {
456456 const obsConfig = { childList : true , subtree : true } ,
457457 selectors = { msgDiv : 'div[data-message-author-role]' ,
458- replyDiv : 'div[data-message-author-role=" assistant" ]' } ;
458+ replyDiv : 'div[data-message-author-role=assistant]' } ;
459459
460460 // Create promises
461461 const timeoutPromise = timeout ? new Promise ( resolve => setTimeout ( ( ) => resolve ( false ) , timeout ) ) : null ;
@@ -620,7 +620,7 @@ const chatgpt = {
620620 filename = `${ parsedHtml . querySelector ( 'title' ) . textContent || 'ChatGPT conversation' } .html` ;
621621
622622 // Convert relative CSS paths to absolute ones
623- const cssLinks = parsedHtml . querySelectorAll ( 'link[rel=" stylesheet" ]' ) ;
623+ const cssLinks = parsedHtml . querySelectorAll ( 'link[rel=stylesheet]' ) ;
624624 cssLinks . forEach ( link => {
625625 const href = link . getAttribute ( 'href' ) ;
626626 if ( href ?. startsWith ( '/' ) ) link . setAttribute ( 'href' , 'https://chat.openai.com' + href ) ;
@@ -932,7 +932,7 @@ const chatgpt = {
932932 getLastResponse ( ) { return chatgpt . getChatData ( 'active' , 'msg' , 'chatgpt' , 'latest' ) ; } ,
933933
934934 getNewChatButton ( ) {
935- return document . querySelector ( 'button[data-testid*=" new-chat-button" ], button:has([d^="M15.6729"])' ) ; } ,
935+ return document . querySelector ( 'button[data-testid*=new-chat-button], button:has([d^="M15.6729"])' ) ; } ,
936936
937937 getNewChatLink ( ) { return document . querySelector ( 'nav a[href="/"]' ) ; } ,
938938 getRegenerateButton ( ) { return document . querySelector ( 'button:has([d^="M3.06957"])' ) ; } ,
@@ -949,8 +949,8 @@ const chatgpt = {
949949 getResponseFromAPI ( chatToGet , responseToGet ) { return chatgpt . response . getFromAPI ( chatToGet , responseToGet ) ; } ,
950950 getResponseFromDOM ( pos ) { return chatgpt . response . getFromDOM ( pos ) ; } ,
951951 getScrollToBottomButton ( ) { return document . querySelector ( 'button:has([d^="M12 21C11.7348"])' ) ; } ,
952- getSendButton ( ) { return document . querySelector ( '[data-testid=" send-button" ]' ) ; } ,
953- getStopButton ( ) { return document . querySelector ( 'button[data-testid=" stop-button" ]' ) ; } ,
952+ getSendButton ( ) { return document . querySelector ( '[data-testid=send-button]' ) ; } ,
953+ getStopButton ( ) { return document . querySelector ( 'button[data-testid=stop-button]' ) ; } ,
954954
955955 getUserLanguage ( ) {
956956 return navigator . languages [ 0 ] || navigator . language || navigator . browserLanguage ||
@@ -1211,7 +1211,7 @@ const chatgpt = {
12111211 }
12121212
12131213 const addElementsToMenu = ( ) => {
1214- const optionButtons = document . querySelectorAll ( 'a[role=" menuitem" ]' ) ;
1214+ const optionButtons = document . querySelectorAll ( 'a[role=menuitem]' ) ;
12151215 let cssClasses ;
12161216
12171217 for ( const navLink of optionButtons )
@@ -1230,7 +1230,7 @@ const chatgpt = {
12301230 } ;
12311231
12321232 this . elements . push ( newElement ) ;
1233- const menuBtn = document . querySelector ( 'nav button[id*=" headless" ]' ) ;
1233+ const menuBtn = document . querySelector ( 'nav button[id*=headless]' ) ;
12341234 if ( ! this . addedEvent ) { // to prevent adding more than one event
12351235 menuBtn ?. addEventListener ( 'click' , ( ) => { setTimeout ( addElementsToMenu , 25 ) ; } ) ;
12361236 this . addedEvent = true ; }
@@ -1239,12 +1239,12 @@ const chatgpt = {
12391239 } ,
12401240
12411241 close ( ) {
1242- try { document . querySelector ( 'nav [id*=" menu-button" ][aria-expanded=" true" ]' ) . click ( ) ; }
1242+ try { document . querySelector ( 'nav [id*=menu-button][aria-expanded=true]' ) . click ( ) ; }
12431243 catch ( err ) { console . error ( err . message ) ; }
12441244 } ,
12451245
12461246 open ( ) {
1247- try { document . querySelector ( 'nav [id*=" menu-button" ][aria-expanded=" false" ]' ) . click ( ) ; }
1247+ try { document . querySelector ( 'nav [id*=menu-button][aria-expanded=false]' ) . click ( ) ; }
12481248 catch ( err ) { console . error ( err . message ) ; }
12491249 }
12501250 } ,
@@ -1518,7 +1518,7 @@ const chatgpt = {
15181518 } ,
15191519
15201520 getFromDOM ( pos ) {
1521- const responseDivs = document . querySelectorAll ( 'div[data-message-author-role=" assistant" ]' ) ,
1521+ const responseDivs = document . querySelectorAll ( 'div[data-message-author-role=assistant]' ) ,
15221522 strPos = pos . toString ( ) . toLowerCase ( ) ;
15231523 let response = '' ;
15241524 if ( ! responseDivs . length ) return console . error ( 'No conversation found!' ) ;
@@ -1825,15 +1825,15 @@ const chatgpt = {
18251825 isOff ( ) { return ! this . isOn ( ) ; } ,
18261826 isOn ( ) {
18271827 const sidebar = ( ( ) => {
1828- return chatgpt . sidebar . exists ( ) ? document . querySelector ( '[class*=" sidebar" ]' ) : null ; } ) ( ) ;
1828+ return chatgpt . sidebar . exists ( ) ? document . querySelector ( '[class*=sidebar]' ) : null ; } ) ( ) ;
18291829 if ( ! sidebar ) { console . error ( 'Sidebar element not found!' ) ; return false ; }
18301830 else return chatgpt . browser . isMobile ( ) ?
18311831 document . documentElement . style . overflow == 'hidden'
18321832 : sidebar . style . visibility != 'hidden' && sidebar . style . width != '0px' ;
18331833 } ,
18341834
18351835 toggle ( ) {
1836- const sidebarToggle = document . querySelector ( 'button[data-testid*=" sidebar-button" ]' ) ;
1836+ const sidebarToggle = document . querySelector ( 'button[data-testid*=sidebar-button]' ) ;
18371837 if ( ! sidebarToggle ) console . error ( 'Sidebar toggle not found!' ) ;
18381838 sidebarToggle . click ( ) ;
18391839 } ,
@@ -1943,8 +1943,8 @@ const cjsBtnActions = ['click', 'get'], cjsTargetTypes = [ 'button', 'link', 'di
19431943for ( const btnAction of cjsBtnActions ) {
19441944 chatgpt [ btnAction + 'Button' ] = function handleButton ( buttonIdentifier ) {
19451945 const button = / ^ [ . # ] / . test ( buttonIdentifier ) ? document . querySelector ( buttonIdentifier )
1946- : / s e n d / i. test ( buttonIdentifier ) ? document . querySelector ( 'form button[class*=" bottom" ]' )
1947- : / s c r o l l / i. test ( buttonIdentifier ) ? document . querySelector ( 'button[class*=" cursor" ]' )
1946+ : / s e n d / i. test ( buttonIdentifier ) ? document . querySelector ( 'form button[class*=bottom]' )
1947+ : / s c r o l l / i. test ( buttonIdentifier ) ? document . querySelector ( 'button[class*=cursor]' )
19481948 : ( function ( ) { // get via text content
19491949 for ( const button of document . querySelectorAll ( 'button' ) ) { // try buttons
19501950 if ( button . textContent . toLowerCase ( ) . includes ( buttonIdentifier . toLowerCase ( ) ) ) {
0 commit comments