New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a frame fails to load due to a mixed content issue, the main Page is never considered loaded. #1936
Comments
Shower thought: on top of this, it would be great to have a |
To be honest, I've found the promise returned by |
I'm having the same issue. You can try this workaround: "use strict";
const puppeteer = require("puppeteer");
const url = "https://pste.eu/p/awIC.html";
(async () => {
const browser = await puppeteer.launch({
args: [ "--no-sandbox", "--disable-gpu" ]
});
const page = await browser.newPage();
await page.evaluate((url)=>{window.location = url}, url);
await page.waitFor('body > iframe');
console.log('working!');
await browser.close();
})(); |
This allow the page to load but there is no way to capture the error. |
Same issue, tried @GregRos Can you somewhat retrieve a response using this method? What was the status code, the HTTP headers, etc? How do you navigate without goto? Do you use Edit: I tried something like this instead of using return new Promise((resolve) => {
let returnValue = null;
page.on('response', (response) => {
if (returnValue === null) {
returnValue = response;
}
})
page.on('domcontentloaded', () => {
resolve(returnValue);
})
return page.evaluate((url) => window.location = url, url);
}); |
This patch teaches Page.waitForNavigation to correctly handle navigation to pages that have frames that might never load. These frames include: - frames which main resource loading was aborted due to mixed-content error - frames that artificially called `window.stop()` to interrupt loading themselves Fixes puppeteer#1936.
…nt (#2339) This patch teaches Page.waitForNavigation to correctly handle navigation to pages that have frames that might never load. These frames include: - frames which main resource loading was aborted due to mixed-content error - frames that artificially called `window.stop()` to interrupt loading themselves Fixes #1936.
Could u pls share that ? |
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
Try to load a HTTPS URL including an
iframe
with a HTTPsrc
(normally blocked with a message like:Mixed Content: The page at '...' was loaded over HTTPS, but requested an insecure resource '...'. This request has been blocked; the content must be served over HTTPS.
)Check this example:
Content of https://pste.eu/p/awIC.html
What is the expected result?
The page loads.
page.goto(...)
returns a resolved promise.What happens instead?
The page never loads.
page.goto(...)
returns with a rejected promise after a 30 seconds timeout (Error: Navigation Timeout Exceeded: 30000ms exceeded
).Notes
As far as I understand, this is because the
iframe
never triggers theload
event, and theNavigatorWatcher
iterates over all iframes to check if aload
event occured before resolving thenavigationPromise
. This issue may need some devtools protocol additions to be fixed.The text was updated successfully, but these errors were encountered: