Skip to content

Commit e979d5e

Browse files
committed
Don't pass a reference to the page into frame
1 parent 5c7153c commit e979d5e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pyppeteer/frame_manager.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _onFrameAttached(self, frameId: str, parentFrameId: str) -> None:
119119
if frameId in self._frames:
120120
return
121121
parentFrame = self._frames.get(parentFrameId)
122-
frame = Frame(self._client, self._page, parentFrame, frameId)
122+
frame = Frame(self._client, parentFrame, frameId)
123123
self._frames[frameId] = frame
124124
self.emit(FrameManager.Events.FrameAttached, frame)
125125

@@ -147,7 +147,7 @@ def _onFrameNavigated(self, framePayload: dict) -> None:
147147
frame._id = _id
148148
else:
149149
# Initial main frame navigation.
150-
frame = Frame(self._client, self._page, None, _id)
150+
frame = Frame(self._client, None, _id)
151151
self._frames[_id] = frame
152152
self._mainFrame = frame
153153

@@ -232,10 +232,9 @@ class Frame(object):
232232
Frame objects can be obtained via :attr:`pyppeteer.page.Page.mainFrame`.
233233
"""
234234

235-
def __init__(self, client: CDPSession, page: Any,
236-
parentFrame: Optional['Frame'], frameId: str) -> None:
235+
def __init__(self, client: CDPSession, parentFrame: Optional['Frame'],
236+
frameId: str) -> None:
237237
self._client = client
238-
self._page = page
239238
self._parentFrame = parentFrame
240239
self._url = ''
241240
self._detached = False

0 commit comments

Comments
 (0)