From 21bae0de35dee7c169625af7f63b3aa3b2637605 Mon Sep 17 00:00:00 2001 From: ds-amrit Date: Mon, 1 Jun 2026 15:39:44 +0530 Subject: [PATCH] fix(connect): use Playwright force=True on LinkedIn click actions LinkedIn's profile page renders an `interop-outlet` overlay that intercepts pointer events on top of the More button and Connect menu items. Playwright's default click action refuses to proceed when an intercepting element is detected, so connection requests fail with a 30s TargetClosedError after 54+ retry attempts. The maintainer already uses `force=True` for the final "Send now" click in `_click_without_note`. Apply the same approach to the three earlier clicks in the flow: - direct.first.click() in _connect_direct - more.first.click() in _connect_via_more - connect_option.first.click() in _connect_via_more This unblocks connection requests for self-hosted users on Apple Silicon (Colima + Rosetta) where the issue was first reproduced. Co-authored-by: Cursor --- linkedin/actions/connect.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linkedin/actions/connect.py b/linkedin/actions/connect.py index cdafcd9f..a84ffb23 100644 --- a/linkedin/actions/connect.py +++ b/linkedin/actions/connect.py @@ -72,7 +72,7 @@ def _connect_direct(session): if direct.count() == 0: return False - direct.first.click() + direct.first.click(force=True) logger.debug("Clicked direct 'Connect' button") error = session.page.locator(SELECTORS["error_toast"]) @@ -95,13 +95,13 @@ def _connect_via_more(session): more = top_card.locator(SELECTORS["more_button"]) if more.count() == 0: return False - more.first.click() + more.first.click(force=True) session.wait() connect_option = page.locator(SELECTORS["connect_option"]) if connect_option.count() == 0: return False - connect_option.first.click() + connect_option.first.click(force=True) logger.debug("Used 'More → Connect' flow") return True