[epiphany/pgriffis/web-extension/bitwarden: 3/5] WebExtensions: Respect clipboardWrite permission




commit 82ee2f9777feedb9bb728d8de82704b10d909019
Author: Patrick Griffis <pgriffis igalia com>
Date:   Tue Jun 14 13:26:02 2022 -0500

    WebExtensions: Respect clipboardWrite permission

 src/webextension/ephy-web-extension-manager.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/webextension/ephy-web-extension-manager.c b/src/webextension/ephy-web-extension-manager.c
index 9af1d7c97..72a19ef8e 100644
--- a/src/webextension/ephy-web-extension-manager.c
+++ b/src/webextension/ephy-web-extension-manager.c
@@ -886,6 +886,9 @@ ephy_web_extensions_manager_create_web_extensions_webview (EphyWebExtension *web
   settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (web_view));
   webkit_settings_set_enable_write_console_messages_to_stdout (settings, TRUE);
 
+  if (ephy_web_extension_has_permission (web_extension, "clipboardWrite"))
+    webkit_settings_set_javascript_can_access_clipboard (settings, TRUE);
+
   g_signal_connect (web_view, "decide-policy", G_CALLBACK (decide_policy_cb), web_extension);
 
   return web_view;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]