mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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;
|
||||
assert(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.emit(FrameManager.Events.FrameAttached, frame);
|
||||
}
|
||||
@ -145,7 +145,7 @@ class FrameManager extends EventEmitter {
|
||||
frame._id = framePayload.id;
|
||||
} else {
|
||||
// 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._mainFrame = frame;
|
||||
@ -256,9 +256,8 @@ class Frame {
|
||||
* @param {?Frame} parentFrame
|
||||
* @param {string} frameId
|
||||
*/
|
||||
constructor(client, page, parentFrame, frameId) {
|
||||
constructor(client, parentFrame, frameId) {
|
||||
this._client = client;
|
||||
this._page = page;
|
||||
this._parentFrame = parentFrame;
|
||||
this._url = '';
|
||||
this._id = frameId;
|
||||
|
Loading…
Reference in New Issue
Block a user