def on_request_geo_permission(self, view, frame, decision, data=None): d = ConfirmDialog(self.app.name, _('Geolocation permission requested'), _('%s wants to know your current location. Do you want to share?'\ % (frame.get_uri() or self.app.name)), None, self, _('Share')) response = d.run() d.destroy() if response == Gtk.ResponseType.YES: WebKit.geolocation_policy_allow(decision) else: WebKit.geolocation_policy_deny(decision) return True
def on_permission_request(self, widget, frame, geolocationpolicydecision): WebKit.geolocation_policy_allow(geolocationpolicydecision) return True