@@ -40,7 +40,7 @@ const setupStealth = async (page: Page): Promise<void> => {
4040 app : { } ,
4141 csi : ( ) => { } ,
4242 loadTimes : ( ) => { } ,
43- runtime : { } ,
43+ runtime : { }
4444 }
4545 } )
4646}
@@ -66,7 +66,7 @@ const detectPlatform = (url: string): Platform => {
6666
6767const getSelectors = ( platform : Platform , customSelector ?: string ) => ( {
6868 msgSelector : customSelector ?? ( platform === 'claude' ? CLAUDE_SELECTOR : CHATGPT_MSG_SELECTOR ) ,
69- waitSelector : customSelector ?? ( platform === 'claude' ? CLAUDE_SELECTOR : CHATGPT_WAIT_SELECTOR ) ,
69+ waitSelector : customSelector ?? ( platform === 'claude' ? CLAUDE_SELECTOR : CHATGPT_WAIT_SELECTOR )
7070} )
7171
7272export const fetchTxt = async ( url : string , options : FetchOptions = { } ) : Promise < string > => {
@@ -208,11 +208,16 @@ export const fetchPdf = async (url: string, options: FetchOptions = {}): Promise
208208
209209 const pageTitle = await ( async ( ) => {
210210 if ( platform === 'claude' ) {
211- const title = await page . evaluate ( ( ) => {
212- const lines = document . body . innerText . split ( '\n' ) . map ( ( l ) => l . trim ( ) ) . filter ( Boolean )
213- const first = lines [ 0 ] ?? ''
214- return / s h a r e d b y | t h i s i s a c o p y | y o u s a i d | c l a u d e r e s p o n d e d / i. test ( first ) ? '' : first
215- } ) . catch ( ( ) => '' )
211+ const title = await page
212+ . evaluate ( ( ) => {
213+ const lines = document . body . innerText
214+ . split ( '\n' )
215+ . map ( ( l ) => l . trim ( ) )
216+ . filter ( Boolean )
217+ const first = lines [ 0 ] ?? ''
218+ return / s h a r e d b y | t h i s i s a c o p y | y o u s a i d | c l a u d e r e s p o n d e d / i. test ( first ) ? '' : first
219+ } )
220+ . catch ( ( ) => '' )
216221 if ( title ) return title
217222 }
218223 return page . title ( )
@@ -322,9 +327,11 @@ export const fetchPdf = async (url: string, options: FetchOptions = {}): Promise
322327
323328 // Strip Claude action bars (copy, share, thumbs up/down icons below each turn)
324329 if ( platform === 'claude' ) {
325- await page . evaluate ( ( ) => {
326- document . querySelectorAll < HTMLElement > ( '[data-test-render-count] button, [data-test-render-count] [role="button"]' ) . forEach ( ( el ) => el . remove ( ) )
327- } ) . catch ( ( ) => { } )
330+ await page
331+ . evaluate ( ( ) => {
332+ document . querySelectorAll < HTMLElement > ( '[data-test-render-count] button, [data-test-render-count] [role="button"]' ) . forEach ( ( el ) => el . remove ( ) )
333+ } )
334+ . catch ( ( ) => { } )
328335 }
329336
330337 await page . evaluate ( ( el ) => {
0 commit comments