mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user