fix: don't pass a reference to the page into frames (#2766)
This commit is contained in:
parent
b20cde67c6
commit
f197d2e208
@ -118,7 +118,7 @@ class FrameManager extends EventEmitter {
|
|||||||
return;
|
return;
|
||||||
assert(parentFrameId);
|
assert(parentFrameId);
|
||||||
const parentFrame = this._frames.get(parentFrameId);
|
const parentFrame = this._frames.get(parentFrameId);
|
||||||
const frame = new Frame(this._client, this._page, parentFrame, frameId);
|
const frame = new Frame(this._client, parentFrame, frameId);
|
||||||
this._frames.set(frame._id, frame);
|
this._frames.set(frame._id, frame);
|
||||||
this.emit(FrameManager.Events.FrameAttached, frame);
|
this.emit(FrameManager.Events.FrameAttached, frame);
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ class FrameManager extends EventEmitter {
|
|||||||
frame._id = framePayload.id;
|
frame._id = framePayload.id;
|
||||||
} else {
|
} else {
|
||||||
// Initial main frame navigation.
|
// Initial main frame navigation.
|
||||||
frame = new Frame(this._client, this._page, null, framePayload.id);
|
frame = new Frame(this._client, null, framePayload.id);
|
||||||
}
|
}
|
||||||
this._frames.set(framePayload.id, frame);
|
this._frames.set(framePayload.id, frame);
|
||||||
this._mainFrame = frame;
|
this._mainFrame = frame;
|
||||||
@ -256,9 +256,8 @@ class Frame {
|
|||||||
* @param {?Frame} parentFrame
|
* @param {?Frame} parentFrame
|
||||||
* @param {string} frameId
|
* @param {string} frameId
|
||||||
*/
|
*/
|
||||||
constructor(client, page, parentFrame, frameId) {
|
constructor(client, parentFrame, frameId) {
|
||||||
this._client = client;
|
this._client = client;
|
||||||
this._page = page;
|
|
||||||
this._parentFrame = parentFrame;
|
this._parentFrame = parentFrame;
|
||||||
this._url = '';
|
this._url = '';
|
||||||
this._id = frameId;
|
this._id = frameId;
|
||||||
|
Loading…
Reference in New Issue
Block a user