__doPostBack is not defined error when running puppeteer in browser rendering. I tried the same code in local puppeteer on node, and it works just fine. The page loads fine on both, a screenshot of the page looks the same on both. I also used puppeteer verison 17 locally, since that's the version that @cloudflare/puppeteer is forked from. Still not working. Any thoughts?Page.waitForFunction() to return a truthy value https://pptr.dev/api/puppeteer.page.waitforfunction__doPostBack will not be instantaneous.waitUntil set to loadawait page.waitForFunction(() => typeof window.__doPostBack === 'function');networkidle0 actually yeahTimeoutError: waiting for function failed: timeout 30000ms exceededignoreHTTPSErrors: true. Instead of default puppeteer.launchignoreHTTPSErrors enabled.custom_launch a trypuppeteer.connect pass it the ignoreHTTPSErrors: trueTimeoutError: waiting for function failed: timeout 30000ms exceeded__doPostBack is defined inline in the javascript of the page, not loaded externallyawait page.goto('https://google.com', { waitUntil: 'load' });async custom_launch(endpoint: BrowserWorker): Promise<Browser> {
const res = await endpoint.fetch('/v1/acquire');
const status = res.status;
const text = await res.text();
if (status !== 200) {
throw new Error(
`Unabled to create new browser: code: ${status}: message: ${text}`
);
}
// Got a 200, so response text is actually an AcquireResponse
const response: { sessionId: string } = JSON.parse(text);
const transport = await WorkersWebSocketTransport.create(
endpoint,
response.sessionId
);
return puppeteer.connect({ transport, sessionId: response.sessionId, ignoreHTTPSErrors: true, defaultViewport: { width: 1920, height: 1080 } });
}ignoreHTTPSErrors: trueignoreHTTPSErrors: truepuppeteer.launchignoreHTTPSErrorscustom_launchpuppeteer.connect<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>