[epiphany/pgriffis/web-extension-beastify: 4/6] WebExtensions: Create custom CSS in private world




commit ec70a9f3bf42bb86c1ce3111d9c37f8333f98904
Author: Patrick Griffis <pgriffis igalia com>
Date:   Fri May 20 13:42:46 2022 -0500

    WebExtensions: Create custom CSS in private world

 src/webextension/ephy-web-extension.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/webextension/ephy-web-extension.c b/src/webextension/ephy-web-extension.c
index 1d9d75945..28d70d5b9 100644
--- a/src/webextension/ephy-web-extension.c
+++ b/src/webextension/ephy-web-extension.c
@@ -1129,7 +1129,11 @@ web_extension_custom_css_new (EphyWebExtension *self,
   WebExtensionCustomCSS *css = g_malloc0 (sizeof (WebExtensionCustomCSS));
 
   css->code = g_strdup (code);
-  css->style = webkit_user_style_sheet_new (css->code, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, 
WEBKIT_USER_STYLE_LEVEL_USER, NULL, NULL);
+  css->style = webkit_user_style_sheet_new_for_world (css->code,
+                                                      WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES,
+                                                      WEBKIT_USER_STYLE_LEVEL_USER,
+                                                      ephy_web_extension_get_guid (self),
+                                                      NULL, NULL);
 
   self->custom_css = g_list_append (self->custom_css, css);
 


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