diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index e89d01a88..f29b67708 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -72,7 +72,13 @@ class WebEngineView(QWebEngineView): if proxy is not None: return proxy - children = self.findChildren(QWidget) + # We only want the RenderWidgetHostViewQtDelegateWidget + # (which is a QWidget) but not e.g. a QMenu. + # pylint: disable=unidiomatic-typecheck + children = [child for child in self.findChildren(QWidget) + if type(child) == QWidget] + # pylint: enable=unidiomatic-typecheck + if not children: return None