Skip to content

Commit

Permalink
browser(firefox): support proxy bypass (#2467)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Jun 4, 2020
1 parent 58e2ffc commit a26311a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion browser_patches/firefox/BUILD_NUMBER
@@ -1 +1 @@
1102
1103
4 changes: 4 additions & 0 deletions browser_patches/firefox/juggler/NetworkObserver.js
Expand Up @@ -166,6 +166,10 @@ class NetworkObserver {
proxyFilter.onProxyFilterResult(defaultProxyInfo);
return;
}
if (proxy.bypass.some(domain => channel.URI.host.endsWith(domain))) {
proxyFilter.onProxyFilterResult(defaultProxyInfo);
return;
}
proxyFilter.onProxyFilterResult(protocolProxyService.newProxyInfo(
proxy.type,
proxy.host,
Expand Down
4 changes: 2 additions & 2 deletions browser_patches/firefox/juggler/protocol/BrowserHandler.js
Expand Up @@ -151,8 +151,8 @@ class BrowserHandler {
this._targetRegistry.browserContextForId(browserContextId).httpCredentials = nullToUndefined(credentials);
}

async setProxy({browserContextId, type, host, port}) {
this._targetRegistry.browserContextForId(browserContextId).proxy = { type, host, port };
async setProxy({browserContextId, type, host, port, bypass}) {
this._targetRegistry.browserContextForId(browserContextId).proxy = { type, host, port, bypass };
}

setRequestInterception({browserContextId, enabled}) {
Expand Down
1 change: 1 addition & 0 deletions browser_patches/firefox/juggler/protocol/Protocol.js
Expand Up @@ -263,6 +263,7 @@ const Browser = {
params: {
browserContextId: t.Optional(t.String),
type: t.Enum(['http', 'https', 'socks', 'socks4']),
bypass: t.Array(t.String),
host: t.String,
port: t.Number,
},
Expand Down

0 comments on commit a26311a

Please sign in to comment.