From 0fef141db5f7704809effe5cc734b2201a4c34fe Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 12 Sep 2016 09:43:08 +0200 Subject: [PATCH] Handle QBuffer in on_feature_permission_requested --- qutebrowser/browser/webkit/webpage.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qutebrowser/browser/webkit/webpage.py b/qutebrowser/browser/webkit/webpage.py index 435768f83..0db7b1468 100644 --- a/qutebrowser/browser/webkit/webpage.py +++ b/qutebrowser/browser/webkit/webpage.py @@ -319,6 +319,13 @@ class BrowserPage(QWebPage): @pyqtSlot('QWebFrame*', 'QWebPage::Feature') def on_feature_permission_requested(self, frame, feature): """Ask the user for approval for geolocation/notifications.""" + if not isinstance(frame, QWebFrame): # pragma: no cover + # This makes no sense whatsoever, but someone reported this being + # called with a QBuffer... + log.misc.error("on_feature_permission_requested got called with " + "{!r}!".format(frame)) + return + options = { QWebPage.Notifications: ('content', 'notifications'), QWebPage.Geolocation: ('content', 'geolocation'),