Auto-deploy: 2026-08-05 18:06:36

This commit is contained in:
Hamza-Ayed
2026-08-05 18:06:36 +03:00
parent 7d12a87878
commit ede306651f
2 changed files with 22 additions and 2 deletions
+21 -1
View File
@@ -98,7 +98,27 @@
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
// 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,
+1 -1
View File
File diff suppressed because one or more lines are too long