diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 7187e1c3ece8..afd79d756595 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -7368,6 +7368,12 @@ PresShell::HandleEvent(nsIFrame* aFrame, frame == mFrameConstructor->GetRootFrame()) { nsIFrame* popupFrame = nsLayoutUtils::GetPopupFrameForEventCoordinates(rootPresContext, aEvent); + // If a remote browser is currently capturing input break out if we + // detect a chrome generated popup. + if (popupFrame && capturingContent && + EventStateManager::IsRemoteTarget(capturingContent)) { + capturingContent = nullptr; + } // If the popupFrame is an ancestor of the 'frame', the frame should // handle the event, otherwise, the popup should handle it. if (popupFrame &&