[epiphany] Fix webextension critical message
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Fix webextension critical message
- Date: Tue, 2 Feb 2021 19:29:26 +0000 (UTC)
commit a0897660671e681fa6c24725f2307b137cf1501e
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Tue Feb 2 17:52:53 2021 +0100
Fix webextension critical message
Fixes ** (epiphany:25129): CRITICAL **: 17:34:25.183: WebKitUserScript*
webkit_user_script_new_for_world(const gchar*, WebKitUserContentInjectedFrames,
WebKitUserScriptInjectionTime, const char*, const gchar* const*, const gchar* const*): assertion 'source'
failed
src/webextension/ephy-web-extension-manager.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/webextension/ephy-web-extension-manager.c b/src/webextension/ephy-web-extension-manager.c
index 009168dee..bfed03f85 100644
--- a/src/webextension/ephy-web-extension-manager.c
+++ b/src/webextension/ephy-web-extension-manager.c
@@ -875,10 +875,13 @@ run_background_script (EphyWebExtensionManager *self,
base_uri = g_strdup_printf ("webextension://%s/", ephy_web_extension_get_guid (web_extension));
for (unsigned int i = 0; i < scripts->len; i++) {
- char *script_file = g_ptr_array_index (scripts, i);
+ const char *script_file = g_ptr_array_index (scripts, i);
g_autofree char *data = NULL;
WebKitUserScript *user_script;
+ if (!script_file)
+ continue;
+
data = ephy_web_extension_get_resource_as_string (web_extension, script_file);
user_script = webkit_user_script_new_for_world (data,
WEBKIT_USER_CONTENT_INJECT_TOP_FRAME,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]