[epiphany/mcatanzaro/webextension-guid: 2/2] Web process extension must always create a custom script world




commit 94e18ebee7789937d2eec6b73a9746c745b05447
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Feb 3 16:52:08 2021 -0600

    Web process extension must always create a custom script world
    
    This code is currently unreachable beacuse guid is always sent when
    initializing the web process. But if it were not unreachable, it would
    be a major security issue, because Epiphany internal APIs would be
    exposed to the web. So let's remove this.
    
    I think this was maybe a leftover from an earlier draft of the
    WebExtension branch that perhaps attempted to use a separate
    EphyWebProcessExtension for each WebExtension? Regardless, it's not
    going to work.

 embed/web-process-extension/ephy-web-process-extension.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/embed/web-process-extension/ephy-web-process-extension.c 
b/embed/web-process-extension/ephy-web-process-extension.c
index de1cd6302..429f961bb 100644
--- a/embed/web-process-extension/ephy-web-process-extension.c
+++ b/embed/web-process-extension/ephy-web-process-extension.c
@@ -793,11 +793,7 @@ ephy_web_process_extension_initialize (EphyWebProcessExtension *extension,
 
   extension->initialized = TRUE;
 
-  /* Note: An empty guid is used ONLY for WebExtensions which do have an own initialization function */
-  if (strlen (guid) > 0)
-    extension->script_world = webkit_script_world_new_with_name (guid);
-  else
-    extension->script_world = webkit_script_world_get_default ();
+  extension->script_world = webkit_script_world_new_with_name (guid);
 
   g_signal_connect (extension->script_world,
                     "window-object-cleared",


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