Skip to content

fix(linkedin): scroll the real container so profile-read sees Experience and Education (#417) - #465

Open
Agnik47 wants to merge 1 commit into
agentrhq:mainfrom
Agnik47:fix/417-profile-read-workspace-scroll
Open

fix(linkedin): scroll the real container so profile-read sees Experience and Education (#417)#465
Agnik47 wants to merge 1 commit into
agentrhq:mainfrom
Agnik47:fix/417-profile-read-workspace-scroll

Conversation

@Agnik47

@Agnik47 Agnik47 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #417.

Cause

profile-read calls page.autoScroll(), which is window.scrollTo (src/browser/dom-helpers.ts:133). LinkedIn's current profile UI scrolls inside main#workspace, so the window scroller never moves, the lazy loaders for Experience and Education never fire, and the command exits successfully with both fields empty — while profile-experience returns the same profile's entries.

The reporter's read-only inspection matches: window.scrollY stayed 0, and scrolling main#workspace brought the headings into the DOM.

Fix

plugins/linkedin/shared.js gains buildSectionScrollScript / scrollToSections, following the #workspace pattern already used by post-comments.js:

  • Scroll the element that actually scrolls — main#workspace, else the nearest scrollable ancestor of main, else the window.
  • Stop as soon as every requested heading is in the DOM.
  • One atEnd round is not the end. LinkedIn lazy-loads on reaching the bottom, so the container grows and the next round has further to travel; the helper requires two consecutive end rounds with no newly found section.
  • Never throw. A layout the helper cannot scroll is not a command failure, only a reason the extraction below it may see fewer sections.

profile-read.js keeps page.autoScroll() ahead of the new call so older window-scrolling layouts are unaffected.

Contract

  • profile-read loads About, Experience, Education, and Featured on a main#workspace layout.
  • Window-scrolling layouts keep their existing behavior.
  • Output columns are unchanged.

Tests

plugins/linkedin/test/shared-scroll.test.js (new), driving the generated script through JSDOM:

  • main#workspace is scrolled and the window scroller is not touched.
  • Requested headings are reported once present.
  • A layout with no inner container falls back to window.scrollTo.
  • atEnd is reported at the bottom of the container.
  • The round loop stops on found sections, stops on a stable end, keeps going past an atEnd round that lazy-loaded a new section, respects the round budget, and returns instead of throwing when evaluate fails.

plugins/linkedin/test/profile-read.test.js: a main#workspace fixture where the sections appear only on the third round now resolves with non-empty experience and education, asserting the scroll rounds run before extraction and that autoScroll is still called.

npx vitest run --project plugin plugins/linkedin — 28 files, 260 tests passed.
node scripts/check-plugin-pr-scope.mjs upstream/main HEAD — exit 0. npm run check:plugin-parity — OK.

Scope

One adapter and one shared helper in the LinkedIn plugin. autoScrollJs is left alone deliberately: changing the generic scroller would affect every adapter in the repo, and this issue is scoped to the profile layout.

…nce and Education (agentrhq#417)

`page.autoScroll()` drives `window.scrollTo`, but LinkedIn's current profile UI
scrolls inside `main#workspace`. The window scroller never moves, the lazy
loaders for later sections never fire, and `profile-read` exits successfully
with empty `experience` and `education` while `profile-experience` returns the
same profile's entries.

`scrollToSections` now steps the element that actually scrolls — `main#workspace`,
else the nearest scrollable ancestor of `main`, else the window — and stops as
soon as the requested headings are in the DOM. One `atEnd` round is not the end:
LinkedIn lazy-loads on reaching the bottom, so the helper requires two
consecutive end rounds with no newly found section. `page.autoScroll()` stays
ahead of it for older window-scrolling layouts.

The helper never throws: a layout it cannot scroll is not a command failure.
@github-actions

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — low confidence

The automated review could not reach a fully supported conclusion.

Limitations

  • The automated review returned an invalid structured result.

This review is advisory and does not block merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: linkedin/profile-read misses sections inside main#workspace

1 participant