Fix none working geolocation=always #580.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 18 Nov 2019 22:33:08 +0000 (23:33 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 18 Nov 2019 22:33:08 +0000 (23:33 +0100)
The 'permission-request' return value is only used to identify if the
callback made a decision or not.

src/main.c

index 9d4610e..ff1817b 100644 (file)
@@ -2016,9 +2016,11 @@ static gboolean on_permission_request(WebKitWebView *webview,
         if (strcmp(geolocation_setting, "ask") == 0) {
             msg = "access your location";
         } else if (strcmp(geolocation_setting, "always") == 0) {
+            webkit_permission_request_allow(request);
             return TRUE;
         } else if (strcmp(geolocation_setting, "never") == 0) {
-            return FALSE;
+            webkit_permission_request_deny(request);
+            return TRUE;
         }
     } else if (WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST(request)) {
         if (webkit_user_media_permission_is_for_audio_device(WEBKIT_USER_MEDIA_PERMISSION_REQUEST(request))) {