Skip to content

Commit 7ad78ea

Browse files
committed
lint fix
1 parent 255556c commit 7ad78ea

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

src/fetch.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

6767
const 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

7272
export 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 /shared by|this is a copy|you said|claude responded/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 /shared by|this is a copy|you said|claude responded/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

Comments
 (0)