()
| 334 | } |
| 335 | |
| 336 | function collectThreadRows() { |
| 337 | const candidates = [ |
| 338 | ...document.querySelectorAll('tr.zA'), |
| 339 | ...document.querySelectorAll('tr[role="row"]'), |
| 340 | ]; |
| 341 | |
| 342 | const rows = []; |
| 343 | const seenRows = new Set(); |
| 344 | |
| 345 | candidates.forEach((row) => { |
| 346 | if (!row || seenRows.has(row)) return; |
| 347 | seenRows.add(row); |
| 348 | |
| 349 | if (!isDisplayed(row)) return; |
| 350 | |
| 351 | const text = normalizeText(row.textContent || row.innerText || ''); |
| 352 | if (!text) return; |
| 353 | |
| 354 | if ( |
| 355 | row.matches('tr.zA') |
| 356 | || row.querySelector('.bog, .y6, .y2, .afn, [data-thread-id], [data-legacy-thread-id], [data-legacy-last-message-id]') |
| 357 | || /openai|chatgpt|verify|verification|code|验证码/i.test(text) |
| 358 | ) { |
| 359 | rows.push(row); |
| 360 | } |
| 361 | }); |
| 362 | |
| 363 | return rows; |
| 364 | } |
| 365 | |
| 366 | function getRowPreviewText(row) { |
| 367 | const sender = normalizeText( |
no test coverage detected