mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
browser(firefox): stop faking intercepting redirects (#2618)
We just cannot do it, so we report redirects as intercepted: false.
This commit is contained in:
parent
02704e08c8
commit
c544bffee3
@ -1 +1 @@
|
|||||||
1112
|
1113
|
||||||
|
@ -334,23 +334,10 @@ class NetworkObserver {
|
|||||||
const requestId = this._requestId(httpChannel);
|
const requestId = this._requestId(httpChannel);
|
||||||
const isRedirect = this._redirectMap.has(requestId);
|
const isRedirect = this._redirectMap.has(requestId);
|
||||||
const interceptionEnabled = this._isInterceptionEnabledForPage(pageNetwork);
|
const interceptionEnabled = this._isInterceptionEnabledForPage(pageNetwork);
|
||||||
if (!interceptionEnabled) {
|
if (!interceptionEnabled || isRedirect) {
|
||||||
new NotificationCallbacks(this, pageNetwork, httpChannel, false);
|
new NotificationCallbacks(this, pageNetwork, httpChannel, false);
|
||||||
this._sendOnRequest(httpChannel, false);
|
this._sendOnRequest(httpChannel, false);
|
||||||
new ResponseBodyListener(this, pageNetwork, httpChannel);
|
new ResponseBodyListener(this, pageNetwork, httpChannel);
|
||||||
} else if (isRedirect) {
|
|
||||||
// We pretend that redirect is interceptable in the protocol, although it's actually not
|
|
||||||
// and therefore we do not instantiate the interceptor.
|
|
||||||
// TODO: look into REDIRECT_MODE_MANUAL.
|
|
||||||
const interceptors = pageNetwork._ensureInterceptors();
|
|
||||||
interceptors.set(requestId, {
|
|
||||||
_resume: () => {},
|
|
||||||
_abort: () => {},
|
|
||||||
_fulfill: () => {},
|
|
||||||
});
|
|
||||||
new NotificationCallbacks(this, pageNetwork, httpChannel, false);
|
|
||||||
this._sendOnRequest(httpChannel, true);
|
|
||||||
new ResponseBodyListener(this, pageNetwork, httpChannel);
|
|
||||||
} else {
|
} else {
|
||||||
const previousCallbacks = httpChannel.notificationCallbacks;
|
const previousCallbacks = httpChannel.notificationCallbacks;
|
||||||
if (previousCallbacks instanceof Ci.nsIInterfaceRequestor) {
|
if (previousCallbacks instanceof Ci.nsIInterfaceRequestor) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user