fix: cache disabling should stick when toggling request interception (#4260)

This patch:
- refactors `NetworkManager`/`FrameManager` so that they enable all the
relevant domains themselves. This is a preparation for OOPIF support and
migration onto fetch domain.
- moves `networkManager` ownership into `FrameManager`. This way it's clear who owns what.
- stops enabling Security domain: it saves quite some traffic over
websocket since it no longer sends annoying "SecurityStateChanged" events.
Instead, use `Security.setIgnoreCertificateErrors` method.
- consolidates network cache state in network manager. This even fixes a
bug with caching and request interception interop.
This commit is contained in:
Andrey Lushnikov
2019-04-10 00:42:42 -04:00
committed by GitHub
parent 2a7c3fe3e6
commit 19606a3b79
5 changed files with 78 additions and 56 deletions

View File

@@ -37,7 +37,6 @@ class LifecycleWatcher {
});
this._frameManager = frameManager;
this._networkManager = frameManager._networkManager;
this._frame = frame;
this._initialLoaderId = frame._loaderId;
this._timeout = timeout;
@@ -48,7 +47,7 @@ class LifecycleWatcher {
helper.addEventListener(this._frameManager, Events.FrameManager.LifecycleEvent, this._checkLifecycleComplete.bind(this)),
helper.addEventListener(this._frameManager, Events.FrameManager.FrameNavigatedWithinDocument, this._navigatedWithinDocument.bind(this)),
helper.addEventListener(this._frameManager, Events.FrameManager.FrameDetached, this._onFrameDetached.bind(this)),
helper.addEventListener(this._networkManager, Events.NetworkManager.Request, this._onRequest.bind(this)),
helper.addEventListener(this._frameManager.networkManager(), Events.NetworkManager.Request, this._onRequest.bind(this)),
];
this._sameDocumentNavigationPromise = new Promise(fulfill => {