Skip to content

Commit bad8b2e

Browse files
committed
feat(extension): harden LinkedIn Easy Apply and local API access
Background: for LinkedIn job URLs, wait for the tab to settle on a real linkedin.com document instead of trusting the first SPA complete event (waitForLinkedInTabSettled). Content script: target Easy Apply inside #interop-outlet shadow DOM with light-DOM fallbacks; refactor modal flow, timeouts, screening defaults (YES_NO_DEFAULTS), logging, and success detection for 2025+ UI. Manifest: grant http://127.0.0.1/* so the extension can reach a local backend. Popup: add .btn-secondary styles for secondary actions.
1 parent 1f94451 commit bad8b2e

File tree

4 files changed

+1000
-541
lines changed

4 files changed

+1000
-541
lines changed

extension/background/background.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,12 @@ async function processOneJob(application, jobUrl, platform, log) {
211211
log.info(`Tab ${tab.id} opened`);
212212

213213
try {
214-
await waitForTabComplete(tab.id, TAB_LOAD_TIMEOUT_MS);
214+
const isLinkedInJob = /linkedin\.com/i.test(jobUrl);
215+
if (isLinkedInJob) {
216+
await waitForLinkedInTabSettled(tab.id, TAB_LOAD_TIMEOUT_MS);
217+
} else {
218+
await waitForTabComplete(tab.id, TAB_LOAD_TIMEOUT_MS);
219+
}
215220
log.step("tabLoad", "complete");
216221

217222
await delay(2500);
@@ -591,6 +596,25 @@ function waitForTabComplete(tabId, timeoutMs) {
591596
});
592597
}
593598

599+
/** LinkedIn SPA: first "complete" can be shell-only; wait for real linkedin.com URL. */
600+
async function waitForLinkedInTabSettled(tabId, timeoutMs) {
601+
const deadline = Date.now() + timeoutMs;
602+
while (Date.now() < deadline) {
603+
try {
604+
const t = await chrome.tabs.get(tabId);
605+
const url = t.url || "";
606+
if (
607+
t.status === "complete" &&
608+
/linkedin\.com/i.test(url) &&
609+
!url.startsWith("chrome://")
610+
) {
611+
return;
612+
}
613+
} catch (_) {}
614+
await delay(120);
615+
}
616+
}
617+
594618
// ── Broadcast ────────────────────────────────────────────────────────────────
595619

596620
function broadcast(message, current, total) {

0 commit comments

Comments
 (0)