fix webview js and zoomlevel initialization when loading urls or content (GTK)

Tue, 26 Aug 2025 13:39:13 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 26 Aug 2025 13:39:13 +0200
changeset 730
c812d7038731
parent 729
81b698792386
child 731
8487d11b9491

fix webview js and zoomlevel initialization when loading urls or content (GTK)

ui/gtk/webview.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/webview.c	Tue Aug 26 12:43:52 2025 +0200
+++ b/ui/gtk/webview.c	Tue Aug 26 13:39:13 2025 +0200
@@ -103,7 +103,7 @@
 }
 
 void ui_webview_load_url(UiGeneric *g, const char *url) {
-    WebViewData data = { .uri = (char*)url, .type = WEBVIEW_CONTENT_URL };
+    WebViewData data = { .uri = (char*)url, .type = WEBVIEW_CONTENT_URL, .javascript = TRUE, .zoom = 1 };
     g->set(g, &data, UI_WEBVIEW_OBJECT_TYPE);
 }
 
@@ -129,6 +129,8 @@
     data.mimetype = (char*)mimetype;
     data.encoding = (char*)encoding;
     data.type = WEBVIEW_CONTENT_CONTENT;
+    data.javascript = FALSE;
+    data.zoom = 1;
     g->set(g, &data, UI_WEBVIEW_OBJECT_TYPE);
 }
 

mercurial