[epiphany/mcatanzaro/window-object-cleared: 15/15] Assert window object is truly cleared in window_object_cleared
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/window-object-cleared: 15/15] Assert window object is truly cleared in window_object_cleared
- Date: Tue, 16 Feb 2021 09:23:37 +0000 (UTC)
commit 0a787de3063511b04835cf5abdcabb069cd79966
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Feb 9 13:38:19 2021 -0600
Assert window object is truly cleared in window_object_cleared
See #1435 for discussion of why we can't do this with older WebKit.
embed/web-process-extension/ephy-web-process-extension.c | 4 ++++
embed/web-process-extension/ephy-webextension-api.c | 7 ++-----
meson.build | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/embed/web-process-extension/ephy-web-process-extension.c
b/embed/web-process-extension/ephy-web-process-extension.c
index f98260e17..82bf3eda8 100644
--- a/embed/web-process-extension/ephy-web-process-extension.c
+++ b/embed/web-process-extension/ephy-web-process-extension.c
@@ -689,6 +689,10 @@ window_object_cleared_cb (WebKitScriptWorld *world,
return;
}
+ result = jsc_context_get_value (js_context, "Ephy");
+ g_assert (jsc_value_is_undefined (result));
+ g_clear_object (&result);
+
bytes = g_resources_lookup_data ("/org/gnome/epiphany-web-process-extension/js/ephy.js",
G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
data = g_bytes_get_data (bytes, &data_size);
result = jsc_context_evaluate_with_source_uri (js_context, data, data_size,
"resource:///org/gnome/epiphany-web-process-extension/js/ephy.js", 1);
diff --git a/embed/web-process-extension/ephy-webextension-api.c
b/embed/web-process-extension/ephy-webextension-api.c
index 44d3b3860..35f5d85fd 100644
--- a/embed/web-process-extension/ephy-webextension-api.c
+++ b/embed/web-process-extension/ephy-webextension-api.c
@@ -90,12 +90,9 @@ set_up_webextensions (EphyWebProcessExtension *extension,
g_autoptr (JSCValue) result = NULL;
const char *data;
gsize data_size;
- static gboolean setup = FALSE;
- if (setup)
- return;
-
- setup = TRUE;
+ result = jsc_context_get_value (js_context, "browser");
+ g_assert (jsc_value_is_undefined (result));
js_browser = jsc_value_new_object (js_context, NULL, NULL);
jsc_context_set_value (js_context, "browser", js_browser);
diff --git a/meson.build b/meson.build
index 42581605f..cf2862ed1 100644
--- a/meson.build
+++ b/meson.build
@@ -75,7 +75,7 @@ conf.set10('ENABLE_GSB', gsb_api_key != '')
glib_requirement = '>= 2.64.0'
gtk_requirement = '>= 3.24.0'
nettle_requirement = '>= 3.4'
-webkitgtk_requirement = '>= 2.31.1'
+webkitgtk_requirement = '>= 2.31.2'
cairo_dep = dependency('cairo', version: '>= 1.2')
gcr_dep = dependency('gcr-3', version: '>= 3.5.5')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]