From c544bffee36e88c89abda272eec69d8f97a4d48e Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 18 Jun 2020 10:40:34 -0700 Subject: [PATCH] browser(firefox): stop faking intercepting redirects (#2618) We just cannot do it, so we report redirects as intercepted: false. --- browser_patches/firefox/BUILD_NUMBER | 2 +- .../firefox/juggler/NetworkObserver.js | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) 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) {