Skip to content

Commit

Permalink
refactor(src/window/linux.cc): remove clipboard check in permissions …
Browse files Browse the repository at this point in the history
…signal
  • Loading branch information
jwerle committed Sep 26, 2023
1 parent 2608bd4 commit 42affb6
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/window/linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ namespace SSC {
NULL
);

webview = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
webview = GTK_WIDGET(WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
"web-context", webContext,
"settings", settings,
"user-content-manager", cm,
"website-policies", policies,
NULL
));
)));

webkit_cookie_manager_set_accept_policy(cookieManager, WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS);

Expand All @@ -211,7 +211,7 @@ namespace SSC {
WebKitWebView* webview,
WebKitPermissionRequest *request,
gpointer userData
) {
) -> bool {
static auto userConfig = SSC::getUserConfig();

if (WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(request)) {
Expand All @@ -230,14 +230,6 @@ namespace SSC {
webkit_permission_request_deny(request);
return FALSE;
}
} else if (WEBKIT_IS_CLIPBOARD_PERMISSION_REQUEST(request)) {
if (userConfig["permissions_allow_clipboard"] != "false") {
webkit_permission_request_allow(request);
return TRUE;
} else {
webkit_permission_request_deny(request);
return FALSE;
}
} else if (WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST(request)) {
if (userConfig["permissions_allow_user_media"] == "false") {
webkit_permission_request_deny(request);
Expand Down

0 comments on commit 42affb6

Please sign in to comment.