browser(firefox): support proxy bypass (#2467)

This commit is contained in:
Andrey Lushnikov 2020-06-04 16:07:45 -07:00 committed by GitHub
parent 58e2ffc991
commit a26311a18a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -1 +1 @@
1102
1103

View File

@ -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,

View File

@ -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}) {

View File

@ -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,
},