Auto-deploy: 2026-08-05 18:06:36
This commit is contained in:
+21
-1
@@ -98,7 +98,27 @@
|
|||||||
return text.length > 4 && text.length < 100 && !NAV_NOISE.test(text);
|
return text.length > 4 && text.length < 100 && !NAV_NOISE.test(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preferred fallback: the browser tab title. LinkedIn sets it to
|
// Preferred fallback 1: Extract from active job link using currentJobId
|
||||||
|
if (!data.jobTitle) {
|
||||||
|
let currentJobId = new URLSearchParams(window.location.search).get('currentJobId');
|
||||||
|
if (!currentJobId) {
|
||||||
|
const match = window.location.pathname.match(/\/jobs\/view\/(\d+)/);
|
||||||
|
if (match) currentJobId = match[1];
|
||||||
|
}
|
||||||
|
if (currentJobId) {
|
||||||
|
const links = document.querySelectorAll(`a[href*="/jobs/view/${currentJobId}"]`);
|
||||||
|
for (const link of links) {
|
||||||
|
const text = link.innerText.trim();
|
||||||
|
// Filter out empty or obviously wrong texts
|
||||||
|
if (plausibleTitle(text) && !text.includes('Easy Apply') && !text.includes('Save')) {
|
||||||
|
data.jobTitle = text;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Preferred fallback 2: the browser tab title. LinkedIn sets it to
|
||||||
// "(N) Job Title | Company | LinkedIn" on every job page, it is not part of
|
// "(N) Job Title | Company | LinkedIn" on every job page, it is not part of
|
||||||
// the React DOM that keeps getting restructured, and it cannot pick up a
|
// the React DOM that keeps getting restructured, and it cannot pick up a
|
||||||
// stray card heading. This is far more reliable than guessing at headings,
|
// stray card heading. This is far more reliable than guessing at headings,
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user