diff --git a/src/Config.zig b/src/Config.zig index fdef5a40c..bb618717e 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -98,6 +98,7 @@ const CommonOptions = .{ .{ .name = "cookie_jar", .type = ?[]const u8 }, .{ .name = "storage_engine", .type = ?Storage.EngineType }, .{ .name = "storage_sqlite_path", .type = ?[:0]const u8 }, + .{ .name = "disable_subframes", .type = bool }, }; fn dumpValidator(_: Allocator, args: *std.process.ArgIterator) !?DumpFormat { @@ -239,6 +240,13 @@ pub fn obeyRobots(self: *const Config) bool { }; } +pub fn disableSubframes(self: *const Config) bool { + return switch (self.mode) { + inline .serve, .fetch, .mcp => |opts| opts.disable_subframes, + else => unreachable, + }; +} + pub fn httpProxy(self: *const Config) ?[:0]const u8 { return switch (self.mode) { inline .serve, .fetch, .mcp => |opts| opts.http_proxy, @@ -526,6 +534,17 @@ pub fn printUsageAndExit(self: *const Config, success: bool) void { \\ we make requests towards. \\ Defaults to false. \\ + \\--disable-subframes + \\ Skip loading