File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,21 @@ fn getBrowserContexts(cmd: anytype) !void {
6666}
6767
6868fn createBrowserContext (cmd : anytype ) ! void {
69+ if (try cmd .params (struct {
70+ disposeOnDetach : bool = false ,
71+ proxyServer : ? []const u8 = null ,
72+ proxyBypassList : ? []const u8 = null ,
73+ originsWithUniversalNetworkAccess : ? []const []const u8 = null ,
74+ })) | params | {
75+ if (params .disposeOnDetach or params .proxyBypassList != null or params .originsWithUniversalNetworkAccess != null ) return error .NotYetImplementedParams ;
76+
77+ if (params .proxyServer ) | proxy | {
78+ // For now the http client is not in the browser context so we assume there is just 1.
79+ const proxy_cp = try cmd .cdp .browser .http_client .allocator .dupe (u8 , proxy );
80+ cmd .cdp .browser .http_client .http_proxy = try std .Uri .parse (proxy_cp );
81+ }
82+ }
83+
6984 const bc = cmd .createBrowserContext () catch | err | switch (err ) {
7085 error .AlreadyExists = > return cmd .sendError (-32000 , "Cannot have more than one browser context at a time" ),
7186 else = > return err ,
You can’t perform that action at this time.
0 commit comments