Implement "errorText" for "Page.navigate"
Categories
(Remote Protocol :: CDP, task, P3)
Tracking
(Not tracked)
People
(Reporter: whimboo, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Currently our implementation doesn't have an errorText
within the return value of Page.navigate
. It means that handling of error pages is currently broken. This is also visible in a couple of Puppeteer unit tests, which simply hang and time out.
Chrome:
puppeteer:protocol SEND ► {"sessionId":"5AE6846B2FBCE6AA1E0E83A3A37C9455","method":"Page.navigate","params":{"url":"https://localhost:8908/empty.html","frameId":"4E0A42E3FF20513139AFCB7B7D28B163"},"id":18} +2ms
puppeteer:protocol ◀ RECV {"id":18,"result":{"frameId":"4E0A42E3FF20513139AFCB7B7D28B163","loaderId":"2E3610A22B50DAC51E5C5B74F5C9CE15","errorText":"net::ERR_CERT_AUTHORITY_INVALID"},"sessionId":"5AE6846B2FBCE6AA1E0E83A3A37C9455"} +106ms
We don't want the exact same error text because that's Chrome specific, but forwarding the error message from Firefox, which might be SSL_ERROR_UNKNOWN
, is fine.
To get this working we might need the implementation for Network.loadingFailed
first (bug 1589784), which basically holds the information.
Reporter | ||
Comment 1•5 years ago
|
||
Bug 1610454 isn't actually a blocker here, because it also fails with the Network domain being disabled. It can perfectly be reproduced by using the chrome-remote-interface.js client directly:
>>> var a = Page.navigate({ url: "https://expired.badssl.com/" });
>>> a
Promise {
{
frameId: 'F17727A83A74C7BC7AAE6214635C7692',
loaderId: '1CA6A28ECB0F929030F040F072536989',
errorText: 'net::ERR_CERT_DATE_INVALID'
},
inspect: [AsyncFunction]
}
To get this failure we would have to wait for the network response or something else. So bug 1603776 blocks us here.
This will be fixed in Bug 1599257
Reporter | ||
Comment 3•5 years ago
|
||
Maja, by one of your comments on Phabricator you mentioned that not all errors can be caught and we need to wait for the network response to get all of them. Shouldn't we use that bug for the remaining errors? Which are those btw?
I think you're referring to my answer in https://phabricator.services.mozilla.com/D71657#inline-421747
The errors are caught, but at least one Puppeteer test ('should fail when navigating to bad SSL') checks Network events in addition to the error message returned by Page.navigate, so it wont' pass until we implement Network.responseReceived etc
In terms of errorText, the only thing that might be missing is potentially around data urls and internal urls, and that is covered by Bug 1632007 and Bug 1632008
Reporter | ||
Comment 5•5 years ago
|
||
(In reply to Maja Frydrychowicz :maja_zf (UTC-4) (maja@mozilla.com) from comment #4)
The errors are caught, but at least one Puppeteer test ('should fail when navigating to bad SSL') checks Network events in addition to the error message returned by Page.navigate, so it wont' pass until we implement Network.responseReceived etc
Ah ok. So we can cover that via bug 1599257. Thanks.
Assignee | ||
Updated•4 years ago
|
Description
•