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




commit c46f190fb7838727c989dd9cfbba80dd529b4f5d
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]