Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

browser(firefox): stop faking intercepting redirects (#2618)

Dmitry Gozmanc544bffee36e
diff --git a/browser_patches/firefox/BUILD_NUMBER b/browser_patches/firefox/BUILD_NUMBER
index ecdb865e10..09e35abcf3 100644
--- a/browser_patches/firefox/BUILD_NUMBER
+++ b/browser_patches/firefox/BUILD_NUMBER
@@ -1 +1 @@
-1112
+1113
diff --git a/browser_patches/firefox/juggler/NetworkObserver.js b/browser_patches/firefox/juggler/NetworkObserver.js
index 6c01e462eb..60fac70cd9 100644
--- a/browser_patches/firefox/juggler/NetworkObserver.js
+++ b/browser_patches/firefox/juggler/NetworkObserver.js
@@ -334,23 +334,10 @@ class NetworkObserver {
const requestId = this._requestId(httpChannel);
const isRedirect = this._redirectMap.has(requestId);
const interceptionEnabled = this._isInterceptionEnabledForPage(pageNetwork);
- if (!interceptionEnabled) {
+ if (!interceptionEnabled || isRedirect) {
new NotificationCallbacks(this, pageNetwork, httpChannel, false);
this._sendOnRequest(httpChannel, false);
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 {
const previousCallbacks = httpChannel.notificationCallbacks;
if (previousCallbacks instanceof Ci.nsIInterfaceRequestor) {