fix: bug in pptr injections

This commit is contained in:
Yanlong Wang 2025-03-08 18:43:39 +08:00
parent e551695d17
commit c19ca2147c
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -271,7 +271,7 @@ function getMaxDepthAndCountUsingTreeWalker(root) {
root,
NodeFilter.SHOW_ELEMENT,
(node) => {
const nodeName = node.nodeName.toLowerCase();
const nodeName = node.nodeName?.toLowerCase();
return (nodeName === 'svg') ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
},
false
@ -1102,7 +1102,7 @@ export class PuppeteerControl extends AsyncService {
snapshot.childFrames = await pSubFrameSnapshots;
}
} catch (err: any) {
this.logger.warn(`Page ${sn}: Failed to finalize ${url}`, { err: marshalErrorLike(err) });
this.logger.warn(`Page ${sn}: Failed to finalize ${url}`, { err });
if (stuff instanceof Error) {
finalized = true;
throw stuff;