Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions browser_patches/firefox/juggler/NetworkObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ class NetworkRequest {
if (this.redirectedFromId) {
// Redirects are not interceptable.
this._sendOnRequest(false);
// Everything we need from the previous request has been inherited above.
redirectedFrom._releaseReferences();
}
}

Expand Down Expand Up @@ -447,6 +449,16 @@ class NetworkRequest {
}

delete this._responseBodyChunks;
this._releaseReferences();
}

// Firefox may keep this object alive long after the request has finished
// through callbacks or delegates, and we don't want to retain the page/window/context.
_releaseReferences() {
this.httpChannel = undefined;
this._originalListener = undefined;
this._pageNetwork = undefined;
this._interceptedChannel = undefined;
}

_shouldIntercept() {
Expand Down
21 changes: 10 additions & 11 deletions browser_patches/firefox/juggler/content/Runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,18 +553,17 @@ class ExecutionContext {

getObjectProperties(objectId) {
if (!this._remoteObjects.has(objectId))
throw new Error('Cannot find object with id = ' + arg.objectId);
throw new Error('Cannot find object with id = ' + objectId);
const result = [];
for (let obj = this._remoteObjects.get(objectId); obj; obj = obj.proto) {
for (const propertyName of obj.getOwnPropertyNames()) {
const descriptor = obj.getOwnPropertyDescriptor(propertyName);
if (!descriptor.enumerable)
continue;
result.push({
name: propertyName,
value: this._createRemoteObject(descriptor.value),
});
}
const obj = this._remoteObjects.get(objectId);
for (const propertyName of obj.getOwnPropertyNames()) {
const descriptor = obj.getOwnPropertyDescriptor(propertyName);
if (!descriptor.enumerable)
continue;
result.push({
name: propertyName,
value: this._createRemoteObject(descriptor.value),
});
}
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"name": "firefox",
"revision": "1546",
"revision": "1548",
"installByDefault": true,
"browserVersion": "155.0",
"title": "Firefox"
Expand Down
Loading