Skip to content

fix: stop hiding the entire LinkedIn feed (v1.3.6)#4

Merged
2gelbuy merged 1 commit into
masterfrom
claude/fix-linkedin-feed-overhide-20260616
Jun 16, 2026
Merged

fix: stop hiding the entire LinkedIn feed (v1.3.6)#4
2gelbuy merged 1 commit into
masterfrom
claude/fix-linkedin-feed-overhide-20260616

Conversation

@2gelbuy

@2gelbuy 2gelbuy commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Why

Uninstall feedback (2026-06-14): "It hid every post on the feed." v1.3.5 fixed an earlier "promoted posts not hidden" report but over-corrected and started hiding organic posts too.

Root causes (both from v1.3.5)

  1. Unbounded subtree scan. hasPromotedStructuralMarker did post.querySelector(PROMOTED_STRUCTURAL_SELECTOR) over the whole post subtree, matching LinkedIn's sponsored-tracked sub-components (social-proof chips, "promoted by your network" rails, tracking beacons) that are embedded inside organic posts → the whole post got hidden. Now anchored to the post root + depth-1 children only, mirroring the existing root-only handling of data-view-tracking-scope.
  2. Substring CSS pre-hide. The injected rule main [data-urn*='promoted'], main [data-id*='promoted'] (!important, no restore path) could match a feed/aggregation container and blank the whole feed. Narrowed to the explicit ad attributes on the post card (data-sponsored-tracking-url, data-promoted-tracking-control-name); promoted-URN ads are still caught by the root-anchored JS pass.

Tests

Added 3 regression tests modeling a realistic multi-post feed with a deep embedded marker. The prior suite rendered one isolated post per case, so a "hides every post" regression passed CI. Suite now 36/36; typecheck + build green (manifest 1.3.6).

🤖 Generated with Claude Code

v1.3.5 over-corrected the earlier "promoted posts not hidden" report and
began hiding organic posts too. Uninstall feedback (2026-06-14): "It hid
every post on the feed."

Root causes (both introduced in v1.3.5):
- hasPromotedStructuralMarker scanned the whole post subtree via
  post.querySelector(), matching LinkedIn's sponsored-tracked
  sub-components embedded inside organic posts. Now anchored to the post
  root plus depth-1 children only, mirroring the existing root-only
  handling of data-view-tracking-scope.
- The injected CSS used substring selectors (main [data-urn*='promoted'],
  main [data-id*='promoted']) with !important and no restore path, which
  could blank a feed/aggregation container. Narrowed to the explicit ad
  attributes on the post card (data-sponsored-tracking-url,
  data-promoted-tracking-control-name); promoted-URN cases are still
  caught by the root-anchored JS pass.

Added 3 regression tests with a realistic multi-post feed and a deep
embedded marker. The prior suite rendered one isolated post per case, so a
"hides every post" regression passed CI.

Tests 36/36, typecheck, build OK (manifest 1.3.6).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 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: 55e1d032-1979-4d7b-a616-3b02bca4538c

📥 Commits

Reviewing files that changed from the base of the PR and between 67f31e9 and fddab13.

📒 Files selected for processing (5)
  • 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

  • Bug Fixes

    • Improved promoted post detection accuracy to prevent hiding organic content. The extension now uses more precise targeting to identify sponsored posts, eliminating false positives from broader pattern matching.
  • Tests

    • Added comprehensive test coverage for promoted content detection edge cases.

Walkthrough

hasPromotedStructuralMarker in linkedin-detector.ts is narrowed from subtree querySelector scanning to a depth-1 direct-child check. The anti-flash CSS in linkedin-feed.content.ts drops broad main-descendant substring selectors in favor of main article-scoped tracking-attribute selectors. Three regression tests are added, and the extension version is bumped to 1.3.6.

Changes

Promoted post detection false-positive fix

Layer / File(s) Summary
hasPromotedStructuralMarker depth-1 fix and regression tests
src/lib/linkedin-detector.ts, src/lib/linkedin-detector.test.ts
Replaces subtree querySelector with an explicit direct-child scan so deep-embedded sponsored-tracking markers inside organic posts no longer trigger hiding. Adds three Vitest cases: deep-embed false-positive, direct-wrapper true-positive, and multi-card selective-hide.
Anti-flash CSS selector narrowed to main article
src/entrypoints/linkedin-feed.content.ts
Drops [data-urn*='promoted'] and [data-id*='promoted'] substring selectors on broad main descendants; replaces them with data-sponsored-tracking-url and data-promoted-tracking-control-name attributes scoped to main article.
Version bump to 1.3.6
package.json, wxt.config.ts
Updates "version" and EXT_VERSION from 1.3.5 to 1.3.6.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • 2gelbuy/linkclean#2: Modifies the same promoted-post detection pipeline in src/lib/linkedin-detector.ts and the anti-flash CSS rules in src/entrypoints/linkedin-feed.content.ts.
✨ 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 claude/fix-linkedin-feed-overhide-20260616
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/fix-linkedin-feed-overhide-20260616
  • 🛠️ tighten validation

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

@2gelbuy 2gelbuy merged commit be2e0cc into master Jun 16, 2026
0 of 2 checks passed
@2gelbuy 2gelbuy deleted the claude/fix-linkedin-feed-overhide-20260616 branch June 16, 2026 01:15
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