mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
Add network.setCacheDisabled
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -9,6 +9,7 @@ const stringify = cdp.stringify;
|
||||
|
||||
const NetworkMethods = enum {
|
||||
enable,
|
||||
setCacheDisabled,
|
||||
};
|
||||
|
||||
pub fn network(
|
||||
@@ -23,6 +24,7 @@ pub fn network(
|
||||
|
||||
return switch (method) {
|
||||
.enable => networkEnable(alloc, id, scanner, ctx),
|
||||
.setCacheDisabled => networkSetCacheDisabled(alloc, id, scanner, ctx),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -36,3 +38,14 @@ fn networkEnable(
|
||||
|
||||
return result(alloc, id orelse msg.id.?, null, null, msg.sessionID);
|
||||
}
|
||||
|
||||
fn networkSetCacheDisabled(
|
||||
alloc: std.mem.Allocator,
|
||||
id: ?u16,
|
||||
scanner: *std.json.Scanner,
|
||||
_: *Ctx,
|
||||
) ![]const u8 {
|
||||
const msg = try getMsg(alloc, void, scanner);
|
||||
|
||||
return result(alloc, id orelse msg.id.?, null, null, msg.sessionID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user