-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
DevTools Error: Failed to construct 'URL': Invalid URL #6145
Comments
Hm, I'm not able to reproduce this, but it clearly looks like others have (#6148). Are you still experiencing this @santamaria7 ? |
@patrickhulce Yes, I am. I ran the Audit on https://www.bbc.com/sport just now for another time and ran into this error again. Because of this, the Audit never finishes and I have to cancel it. |
Spent some time tracking this down thanks to @paulirish TL;DR: We tracked down the root cause of this to mobile only audits from devtools audit panel. It is a result of the website's JS making malformed network requests that we do not catch. We have started look into handling these kinds of network requests. This error seems to originate from BBC Sport itself, in their Javascript they have a feature detector searching for ...
if (!navigator.userAgent.match(/(Android (2.0|2.1))|(Nokia)|(Opera (Mini|Mobi))/)) {
if (!navigator.userAgent.match(/(w(eb)?OSBrowser)|(UCWEB)|(Windows Phone OS 7)|(XBLWP)|(ZuneWP)/)) {
if (navigator.userAgent.match(/MSIE 10.0/))
return !0;
var t = document.getElementById("font-face-test")
, n = t.sheet || t.styleSheet
, r = "";
return n && (n.cssRules && n.cssRules[0] ? r = n.cssRules[0].cssText : r = n.cssText || ""),
/src/i.test(r) && r.indexOf("@font-face") === 0 ? !0 : !1
...
document.write('<style id="font-face-test">@font-face {font-family:"font";src:url("https://")}</style>'),
... Which emits these network requests: The last one is searching for {
"method": "Network.requestWillBeSent",
"params": {
"requestId": "...",
"loaderId": "...",
"documentURL": "https://www.bbc.com/sport",
"request": {
"url": "https:",
"method": "GET",
"headers": {
"Origin": "https://www.bbc.com"
},
"mixedContentType": "blockable",
"initialPriority": "VeryLow",
"referrerPolicy": "no-referrer-when-downgrade"
},
"timestamp": 831346.969485,
"wallTime": 1538411434.25547,
"initiator": {
"type": "other"
},
"type": "Font",
"frameId": "...",
"hasUserGesture": false
}
}, This network request is processed in Lighthouse in onRequestWillBeSent(data) {
this.requestId = data.requestId;
const url = new URL(data.request.url); |
Still an error?
I have empty "Errors" page for local extension. It happens after |
@AlexWayfer – thanks for the report, but 1) we need way more info, such as the URL this happens on + how you are running LH + what version + ... and 2) this needs to be a new issue, this one has been resolved for over 4 years now. New issue would have prompted for the info references in point 1) Please continue in a new issue. |
Initial URL: https://www.bbc.com/sport
Chrome Version: 69.0.3497.100
Error Message: Failed to construct 'URL': Invalid URL
Stack Trace:
The text was updated successfully, but these errors were encountered: