fix(patches): restored dropped + markers in puppeteer-core patch
Eight closing lines of added `.send(...).catch(debugCatchError)` chains in the FrameManager, WebWorker, and #doAcquireWorlds hunks had lost their unified-diff `+` prefix, so they read as context lines. A fresh `bun patch` application searched upstream for those lines in the wrong place and rejected the patch, leaving the un-stealthed puppeteer-core installed. Fixes #5296
This commit is contained in:
@@ -352,7 +352,7 @@ index 2322aa136a47b446e2a7b2c4f0bc751f2fb821d0..2116367ee34bb86948bf956c2afa2f69
|
||||
+ client.send('Page.addScriptToEvaluateOnNewDocument', {
|
||||
+ source: `//# sourceURL=${PuppeteerURL.INTERNAL_URL}`,
|
||||
+ worldName: UTILITY_WORLD_NAME,
|
||||
}).catch(debugCatchError),
|
||||
+ }).catch(debugCatchError),
|
||||
...(frame
|
||||
? Array.from(this.#scriptsToEvaluateOnNewDocument.values())
|
||||
: []).map(script => {
|
||||
@@ -445,7 +445,7 @@ index 2322aa136a47b446e2a7b2c4f0bc751f2fb821d0..2116367ee34bb86948bf956c2afa2f69
|
||||
+ worldName: UTILITY_WORLD_NAME,
|
||||
+ grantUniveralAccess: true,
|
||||
+ })
|
||||
.catch(debugCatchError);
|
||||
+ .catch(debugCatchError);
|
||||
+ const utilityId = iso && typeof iso.executionContextId === 'number' ? iso.executionContextId : undefined;
|
||||
+ if (utilityId !== undefined) {
|
||||
+ this.#onExecutionContextCreated({
|
||||
@@ -486,7 +486,7 @@ index 2322aa136a47b446e2a7b2c4f0bc751f2fb821d0..2116367ee34bb86948bf956c2afa2f69
|
||||
+ }
|
||||
+ }
|
||||
+ catch (error) {
|
||||
debugCatchError(error);
|
||||
+ debugCatchError(error);
|
||||
+ }
|
||||
+ }
|
||||
+ // xxx-stealth: resolve a frame's MAIN-world execution context id without
|
||||
@@ -511,7 +511,7 @@ index 2322aa136a47b446e2a7b2c4f0bc751f2fb821d0..2116367ee34bb86948bf956c2afa2f69
|
||||
+ expression: 'globalThis',
|
||||
+ serializationOptions: { serialization: 'idOnly' },
|
||||
+ })
|
||||
.catch(debugCatchError);
|
||||
+ .catch(debugCatchError);
|
||||
+ return parse(globalThis?.result?.objectId);
|
||||
+ }
|
||||
+ if (utilityId === undefined) {
|
||||
@@ -523,21 +523,21 @@ index 2322aa136a47b446e2a7b2c4f0bc751f2fb821d0..2116367ee34bb86948bf956c2afa2f69
|
||||
+ contextId: utilityId,
|
||||
+ serializationOptions: { serialization: 'idOnly' },
|
||||
+ })
|
||||
.catch(debugCatchError);
|
||||
+ .catch(debugCatchError);
|
||||
+ const utilDocObjectId = utilDoc?.result?.objectId;
|
||||
+ if (typeof utilDocObjectId !== 'string') {
|
||||
+ return undefined;
|
||||
+ }
|
||||
+ const described = await session
|
||||
+ .send('DOM.describeNode', { objectId: utilDocObjectId })
|
||||
.catch(debugCatchError);
|
||||
+ .catch(debugCatchError);
|
||||
+ const backendNodeId = described?.node?.backendNodeId;
|
||||
+ if (typeof backendNodeId !== 'number') {
|
||||
+ return undefined;
|
||||
+ }
|
||||
+ const mainNode = await session
|
||||
+ .send('DOM.resolveNode', { backendNodeId })
|
||||
.catch(debugCatchError);
|
||||
+ .catch(debugCatchError);
|
||||
+ return parse(mainNode?.object?.objectId);
|
||||
}
|
||||
async #createIsolatedWorld(session, name) {
|
||||
@@ -605,7 +605,7 @@ index 3d68f887920ded269eb641273a5a13dee235ae1d..dcdd86c8697c0dbd2dd2162c9a739dd9
|
||||
+ this.#world.setContext(new ExecutionContext(client, { id }, this.#world));
|
||||
+ }
|
||||
+ })
|
||||
.catch(debugCatchError);
|
||||
+ .catch(debugCatchError);
|
||||
this.#client.once('Inspector.workerScriptLoaded', () => {
|
||||
this.#workerLoaded.resolve();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user