Auto-deploy: 2026-06-05 23:09:42
This commit is contained in:
@@ -95,7 +95,10 @@
|
|||||||
let uniqueCards = new Set();
|
let uniqueCards = new Set();
|
||||||
|
|
||||||
// Find the main Action Button (Connect/Message/Follow) which every profile card has
|
// 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;
|
if (!el.innerText) return false;
|
||||||
let txt = el.innerText.toLowerCase().trim();
|
let txt = el.innerText.toLowerCase().trim();
|
||||||
// Must contain the word, but not be a huge paragraph
|
// 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');
|
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 => {
|
actionElements.forEach(btn => {
|
||||||
let container = btn.parentElement;
|
let container = btn.parentElement;
|
||||||
// Go up the DOM tree (max 15 levels) to find the list item wrapper
|
// Go up the DOM tree (max 15 levels) to find the list item wrapper
|
||||||
|
let found = false;
|
||||||
for(let i=0; i<15; i++) {
|
for(let i=0; i<15; i++) {
|
||||||
if (!container) break;
|
if (!container) break;
|
||||||
// A valid card container is usually an LI
|
// A valid card container is usually an LI
|
||||||
@@ -113,16 +119,21 @@
|
|||||||
// Ensure it has some text (a profile has name, headline, etc)
|
// Ensure it has some text (a profile has name, headline, etc)
|
||||||
if (container.innerText && container.innerText.length > 30) {
|
if (container.innerText && container.innerText.length > 30) {
|
||||||
uniqueCards.add(container);
|
uniqueCards.add(container);
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fallback for non-LI structures
|
// Fallback for non-LI structures
|
||||||
if (container.classList && (container.classList.contains('reusable-search__result-container') || container.classList.contains('search-entity'))) {
|
if (container.classList && (container.classList.contains('reusable-search__result-container') || container.classList.contains('search-entity'))) {
|
||||||
uniqueCards.add(container);
|
uniqueCards.add(container);
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
container = container.parentElement;
|
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);
|
const cards = Array.from(uniqueCards);
|
||||||
|
|||||||
Reference in New Issue
Block a user