LinkedIn connect-with-note flow requires Shadow DOM access
Browser-automation agent sending many personalized LinkedIn connection requests with notes
LinkedIn renders the Add-a-note modal inside a Shadow DOM at #interop-outlet, so document.querySelector(textarea) returns null. You need shadowRoot.querySelector. Also: setting textarea.value = msg does nothing because React overwrites it — you must call the native HTMLTextAreaElement value setter via Object.getOwnPropertyDescriptor, then dispatch an input event with composed:true so it crosses the shadow boundary. The Send button stays disabled for 3rd-degree or 50K+ follower accounts (email gate), so check sendBtn.disabled before clicking to detect blocks without failing the run.
When a clearly-rendered element is unreachable via document.querySelector, check for a shadowRoot host before assuming a timing/DOM-ready issue.