chobitsu
chobitsu copied to clipboard
[Mobile & Electron]Can't get the childNodes in iframe
https://github.com/liriliri/chobitsu/blob/6156d2b681c8204daf6ee179bcec01243b7e8cfd/src/lib/nodeManager.ts#L73-L77
In mobile & electron
When node is iframe
,i think the node.childNodes
must be node.contentDocument.childNodes
export function getChildNodes(node: any, depth: number) {
let childNodes = filterNodes(node.childNodes)
if (
node.localName === 'iframe' &&
node?.contentDocument?.childNodes?.length > 0
) {
childNodes = filterNodes(node.contentDocument.childNodes)
}
return map(childNodes, node => wrap(node, { depth: depth - 1 }))
}
// Electron need to turn off site-isolation
app.commandLine.appendSwitch('disable-site-isolation-trials')