only run idle tasks from the root page

This commit is contained in:
Karl Seguin
2026-03-18 19:03:38 +08:00
parent f634c9843d
commit 1aee3db521

View File

@@ -308,6 +308,7 @@ pub fn init(self: *Page, frame_id: u32, session: *Session, parent: ?*Page) !void
document._page = self;
if (comptime builtin.is_test == false) {
if (parent == null) {
// HTML test runner manually calls these as necessary
try self.js.scheduler.add(session.browser, struct {
fn runIdleTasks(ctx: *anyopaque) !?u32 {
@@ -318,6 +319,7 @@ pub fn init(self: *Page, frame_id: u32, session: *Session, parent: ?*Page) !void
}.runIdleTasks, 200, .{ .name = "page.runIdleTasks", .low_priority = true });
}
}
}
pub fn deinit(self: *Page, abort_http: bool) void {
for (self.frames.items) |frame| {