Skip to content

fix: detect LinkedIn 2026 feed DOM promoted posts (v1.3.5)#2

Merged
2gelbuy merged 2 commits into
masterfrom
fix/linkedin-2026-dom-v135
Jun 12, 2026
Merged

fix: detect LinkedIn 2026 feed DOM promoted posts (v1.3.5)#2
2gelbuy merged 2 commits into
masterfrom
fix/linkedin-2026-dom-v135

Conversation

@2gelbuy

@2gelbuy 2gelbuy commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Why

Second uninstall feedback (2026-06-12): promoted posts not hidden. LinkedIn's 2026 feed rewrite (article[data-id="main-feed-card"], actor line in p[componentkey]) was invisible to the v1.3.4 detector — it skipped all <p> content as body copy and covered only ~15 of 28 locales.

What

  • New-DOM containers (main-feed-card, li.feed-item) + LinkedIn's own structural sponsored markers (data-sponsored-tracking-url, quoted-token root-only data-view-tracking-scope)
  • Strict-equality matching for <p> metadata; loose word-boundary matching stays limited to the shipped v1.3.4 keyword list (avoids hiding organic posts with promoted-like headlines)
  • Keywords expanded to ~40 languages; 2-char CJK matched only inside LinkedIn-generated sub-description lines
  • Hiding via injected CSS rule on marker attribute (+static pre-hide on LinkedIn attrs) — survives re-renders, no ad flash
  • Leading+trailing 250 ms throttle replaces starvable resetting debounce
  • Fixes: container-div label false positive, poll innerHTML false positive, never-matching RU newsletter keywords

Verification

  • npm test 33/33, npm run typecheck, npm run build, npm run zip (manifest 1.3.5)
  • Consilium council review passed (run 20260612T092359); 4 blockers fixed
  • Already shipped: CWS PENDING_REVIEW 1.3.5, AMO published (0 errors), Edge submitted

🤖 Generated with Claude Code

Tugelbay Konabayev and others added 2 commits June 12, 2026 09:38
Second uninstall feedback reported promoted posts not hidden. Root cause:
LinkedIn's 2026 feed rewrite (main-feed-card articles, actor line in
p[componentkey]) was invisible to the v1.3.4 detector, which skipped all
<p> content as body copy and only covered ~15 of 28 locales.

- new-DOM containers: article[data-id='main-feed-card'], li.feed-item
- structural sponsored markers: data-sponsored-tracking-url,
  data-view-tracking-scope (quoted-token, root-only), promoted URNs
- strict-equality matching for <p> metadata texts; loose word-boundary
  matching stays limited to the shipped v1.3.4 keyword list
- promoted/suggested keywords expanded to ~40 languages; token matching
  inside LinkedIn-generated sub-description lines covers 2-char CJK
- NFKC + zero-width stripping before comparison
- hiding via injected CSS rule on marker attribute (survives re-renders)
  plus static pre-hide rules on LinkedIn's own sponsored attrs (no flash)
- leading+trailing 250ms throttle replaces starvable resetting debounce
- poll filter uses structural selectors, not innerHTML text scan
- label collection excludes elements containing body copy (fixes organic
  posts mentioning 'sponsored' being hidden in div containers)

Council-reviewed (Consilium 20260612T092359). Tests 33/33, typecheck,
build, zip OK (manifest 1.3.5).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@2gelbuy 2gelbuy merged commit 67fb642 into master Jun 12, 2026
0 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bd63b042-1b39-4a2f-ab73-1278bb85e5bc

📥 Commits

Reviewing files that changed from the base of the PR and between 97f0413 and 0227e2f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • AI_STATUS.md
  • CLAUDE.md
  • package.json
  • src/entrypoints/linkedin-feed.content.ts
  • src/lib/linkedin-detector.test.ts
  • src/lib/linkedin-detector.ts
  • wxt.config.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Enhanced detection of promoted and sponsored content across LinkedIn feeds.
    • Improved handling of promoted labels in multiple languages and formats.
    • Support for newer feed DOM structures.
  • Bug Fixes

    • Improved reliability of hiding promoted content during feed re-renders using stylesheet-based approach.
  • Tests

    • Expanded test coverage for feed post detection and promoted label hiding scenarios.

Walkthrough

Extension version 1.3.5 promotes promoted-post hotfix improvements. The detector gains expanded DOM selectors, stronger text normalization, and multi-tier keyword matching. The content script switches to stylesheet-based element hiding with refined mutation scheduling and selective observer filtering.

Changes

LinkedIn Feed Filter Enhancement v1.3.5

Layer / File(s) Summary
Version and metadata updates
wxt.config.ts, package.json, AI_STATUS.md, CLAUDE.md
Extension version updated from 1.3.3 to 1.3.5. Release status and local documentation paths adjusted for v1.3.5 hotfix cycle tracking.
LinkedIn detector infrastructure and text normalization
src/lib/linkedin-detector.ts (selectors, normalization, keywords)
DOM selectors expanded for 2026 LinkedIn patterns. Text normalization strengthened with NFKC, case-folding, Unicode cleanup, and broader punctuation stripping. Keyword lists split into loose/strict matching tiers for promoted/suggested/newsletter detection.
Label collection and keyword matching
src/lib/linkedin-detector.ts (label pipeline)
Label candidates collected from DOM elements and aria-describedby references with exclusion rules. Loose keyword arrays normalized and strict Sets generated. Metadata-line token matching implemented with max-length constraints.
Promoted and suggested signal aggregation
src/lib/linkedin-detector.ts (signal functions)
Strict metadata extraction via tokenized matching. hasPromotedLabel and hasSuggestedLabel combine strict/loose label checks with metadata and metadata-token matching.
Feed discovery and hiding logic
src/lib/linkedin-detector.ts (integration)
Feed post detection incorporates structural markers and label signals. Poll detection simplified to DOM-role/class checks. shouldHideLinkedInPost checks both structural markers and label signals.
LinkedIn detector test expansion
src/lib/linkedin-detector.test.ts
New tests cover feed containers, newer URN families, promoted label paths (actor divs, metadata, aria-describedby), organic exclusions, main-feed-card DOM, CJK language/format cases, poll handling with hidePolls flag, and interaction-scope regressions.
Content script stylesheet and element management
src/entrypoints/linkedin-feed.content.ts (stylesheet, restore)
Stylesheet-based hiding system with HIDE_STYLE_ID. Element restore refactored to use marker attributes and PREVIOUS_DISPLAY_ATTR instead of inline snapshots.
Content script processing pipeline and scheduling
src/entrypoints/linkedin-feed.content.ts (processing, throttle)
Unified runProcessPass() applies stylesheet, processes posts, and hides sidebar ads. Scheduling switches from fixed delay to leading+trailing throttle (immediate if >600ms, else 250ms wait). Storage listener triggers filter updates.
Content script mutation observer refinement
src/entrypoints/linkedin-feed.content.ts (observer)
Selective filtering via shouldProcessMutation() ignores irrelevant mutations. Observer expands to include characterData and filtered attributes. Initial run switches to runProcessPass().

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/linkedin-2026-dom-v135
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/linkedin-2026-dom-v135
  • 🛠️ tighten validation

Comment @coderabbitai help to get the list of available commands and usage tips.

@2gelbuy 2gelbuy deleted the fix/linkedin-2026-dom-v135 branch June 12, 2026 05:11
2gelbuy added a commit that referenced this pull request Jun 12, 2026
docs: AI_STATUS — v1.3.5 landed via PR #2
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.

1 participant