update lightpanda and wpt URL usage

This commit is contained in:
Karl Seguin
2025-04-09 19:21:59 +08:00
parent be75b5b237
commit 41bd3704ef
2 changed files with 5 additions and 2 deletions

View File

@@ -102,7 +102,7 @@ pub const LightPanda = struct {
try writer.writeByte('\n'); try writer.writeByte('\n');
} }
var req = try self.client.request(.POST, self.uri); var req = try self.client.request(.POST, &self.uri);
defer req.deinit(); defer req.deinit();
req.body = arr.items; req.body = arr.items;

View File

@@ -26,6 +26,7 @@ const parser = @import("netsurf");
const jsruntime = @import("jsruntime"); const jsruntime = @import("jsruntime");
const Loop = jsruntime.Loop; const Loop = jsruntime.Loop;
const Env = jsruntime.Env; const Env = jsruntime.Env;
const URL = @import("../url.zig").URL;
const browser = @import("../browser/browser.zig"); const browser = @import("../browser/browser.zig");
const Window = @import("../html/window.zig").Window; const Window = @import("../html/window.zig").Window;
const storage = @import("../storage/storage.zig"); const storage = @import("../storage/storage.zig");
@@ -66,12 +67,14 @@ pub fn run(arena: *std.heap.ArenaAllocator, comptime dir: []const u8, f: []const
defer renderer.elements.deinit(alloc); defer renderer.elements.deinit(alloc);
defer renderer.positions.deinit(alloc); defer renderer.positions.deinit(alloc);
const url = try URL.parse("https://lightpanda.io", null);
var js_env: Env = undefined; var js_env: Env = undefined;
Env.init(&js_env, alloc, &loop, UserContext{ Env.init(&js_env, alloc, &loop, UserContext{
.url = &url,
.document = html_doc, .document = html_doc,
.cookie_jar = &cookie_jar, .cookie_jar = &cookie_jar,
.http_client = &http_client, .http_client = &http_client,
.uri = try std.Uri.parse("https://lightpanda.io"),
.renderer = &renderer, .renderer = &renderer,
}); });
defer js_env.deinit(); defer js_env.deinit();