From 3de45d7f43f205ecf0b785aba08f6890efb5dadd Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Fri, 5 Jun 2026 23:09:42 +0300 Subject: [PATCH] Auto-deploy: 2026-06-05 23:09:42 --- search_analyzer.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/search_analyzer.js b/search_analyzer.js index 059c033..fb8bd45 100644 --- a/search_analyzer.js +++ b/search_analyzer.js @@ -95,7 +95,10 @@ let uniqueCards = new Set(); // Find the main Action Button (Connect/Message/Follow) which every profile card has - let actionElements = Array.from(document.querySelectorAll('button, a')).filter(el => { + let allButtons = Array.from(document.querySelectorAll('button, a')); + console.log('[LJA] Total buttons/links on page:', allButtons.length); + + let actionElements = allButtons.filter(el => { if (!el.innerText) return false; let txt = el.innerText.toLowerCase().trim(); // Must contain the word, but not be a huge paragraph @@ -103,9 +106,12 @@ return txt.includes('connect') || txt.includes('message') || txt.includes('pending') || txt.includes('follow'); }); + console.log('[LJA] Action buttons found (Connect/Message/etc):', actionElements.length, actionElements.map(e => e.innerText.trim())); + actionElements.forEach(btn => { let container = btn.parentElement; // Go up the DOM tree (max 15 levels) to find the list item wrapper + let found = false; for(let i=0; i<15; i++) { if (!container) break; // A valid card container is usually an LI @@ -113,16 +119,21 @@ // Ensure it has some text (a profile has name, headline, etc) if (container.innerText && container.innerText.length > 30) { uniqueCards.add(container); + found = true; break; } } // Fallback for non-LI structures if (container.classList && (container.classList.contains('reusable-search__result-container') || container.classList.contains('search-entity'))) { uniqueCards.add(container); + found = true; break; } container = container.parentElement; } + if (!found) { + console.log('[LJA] Button found but could not find card container for:', btn.innerText.trim()); + } }); const cards = Array.from(uniqueCards);