Tests that Network.requestWillBeSent is dispatched for speculation-rule base prefetch requests.
Message 0
Network.onRequestWillBeSent{
documentURL : <string>
frameId : <string>
hasUserGesture : false
initiator : {
type : other
}
loaderId : <string>
redirectHasExtraInfo : false
request : {
headers : {
Upgrade-Insecure-Requests : 1
User-Agent : <string>
sec-ch-ua : "content_shell";v="999"
sec-ch-ua-mobile : ?0
sec-ch-ua-platform : "Unknown"
}
initialPriority : VeryHigh
isSameSite : true
method : GET
mixedContentType : none
referrerPolicy : strict-origin-when-cross-origin
url : https://127.0.0.1:8443/inspector-protocol/prefetch/resources/prefetch.https.html
}
requestId : <string>
timestamp : <number>
type : Document
wallTime : <number>
}
Network.onRequestWillBeSentExtraInfo{
associatedCookies : [
]
connectTiming : {
requestTime : <number>
}
headers : {
Accept : text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding : gzip, deflate, br
Accept-Language : en-us,en
Connection : keep-alive
Host : 127.0.0.1:8443
Sec-Fetch-Dest : document
Sec-Fetch-Mode : navigate
Sec-Fetch-Site : none
Sec-Fetch-User : ?1
Upgrade-Insecure-Requests : 1
User-Agent : <string>
sec-ch-ua : "content_shell";v="999"
sec-ch-ua-mobile : ?0
sec-ch-ua-platform : "Unknown"
}
requestId : <string>
}
Network.onResponseReceived{
frameId : <string>
hasExtraInfo : true
loaderId : <string>
requestId : <string>
response : {
connectionId : 10
connectionReused : true
encodedDataLength : 263
fromDiskCache : false
fromPrefetchCache : false
fromServiceWorker : false
headers : {
Accept-Ranges : bytes
Connection : Keep-Alive
Content-Length : 395
Content-Type : text/html
Date : <string>
ETag : <string>
Keep-Alive : timeout=9999
Last-Modified : <string>
Server : Apache
}
mimeType : text/html
protocol : http/1.1
remoteIPAddress : 127.0.0.1
remotePort : 8443
responseTime : <number>
securityDetails : {
certificateId : 0
certificateTransparencyCompliance : unknown
cipher : AES_128_GCM
encryptedClientHello : false
issuer :
keyExchange :
keyExchangeGroup : X25519
protocol : TLS 1.3
sanList : [
]
serverSignatureAlgorithm : 2052
signedCertificateTimestampList : [
]
subjectName :
validFrom : 1542841725
validTo : 1858201725
}
securityState : insecure
status : 200
statusText : OK
timing : {
connectEnd : -1
connectStart : -1
dnsEnd : -1
dnsStart : -1
proxyEnd : -1
proxyStart : -1
pushEnd : 0
pushStart : 0
receiveHeadersStart : <number>
receiveHeadersEnd : <number>
requestTime : <number>
sendEnd : <number>
sendStart : <number>
sslEnd : -1
sslStart : -1
workerFetchStart : -1
workerReady : -1
workerRespondWithSettled : -1
workerStart : -1
}
url : https://127.0.0.1:8443/inspector-protocol/prefetch/resources/prefetch.https.html
}
timestamp : <number>
type : Document
}
Network.onResponseReceivedExtraInfo{
blockedCookies : [
]
headers : {
Accept-Ranges : bytes
Connection : Keep-Alive
Content-Length : 395
Content-Type : text/html
Date : <string>
ETag : <string>
Keep-Alive : timeout=9999
Last-Modified : <string>
Server : Apache
}
headersText : <string>
requestId : <string>
resourceIPAddressSpace : Local
statusCode : 200
}
Network.onLoadingFinished{
encodedDataLength : 658
requestId : <string>
shouldReportCorbBlocking : false
timestamp : <number>
}
Message 1
Network.onRequestWillBeSent{
documentURL : <string>
frameId : <string>
hasUserGesture : false
initiator : {
type : script
url : https://127.0.0.1:8443/inspector-protocol/prefetch/resources/prefetch.https.html
}
loaderId : <string>
redirectHasExtraInfo : false
request : {
headers : {
Accept : text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Purpose : prefetch
Sec-Purpose : prefetch
Upgrade-Insecure-Requests : 1
}
initialPriority : VeryLow
method : GET
referrerPolicy : unsafe-url
url : https://127.0.0.1:8443/inspector-protocol/prefetch/resources/prefetch.https.html?page=2
}
requestId : <string>
timestamp : <number>
type : Prefetch
wallTime : <number>
}
Network.onRequestWillBeSentExtraInfo{
associatedCookies : [
]
connectTiming : {
requestTime : <number>
}
headers : {
Accept : text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding : gzip, deflate, br
Accept-Language : en-us,en
Connection : keep-alive
Host : 127.0.0.1:8443
Purpose : prefetch
Sec-Fetch-Dest : empty
Sec-Fetch-Mode : no-cors
Sec-Fetch-Site : none
Sec-Purpose : prefetch
Upgrade-Insecure-Requests : 1
User-Agent : <string>
}
requestId : <string>
}
Network.onResponseReceived{
frameId : <string>
hasExtraInfo : true
loaderId : <string>
requestId : <string>
response : {
connectionId : 10
connectionReused : true
encodedDataLength : 263
fromDiskCache : false
fromPrefetchCache : false
fromServiceWorker : false
headers : {
Accept-Ranges : bytes
Connection : Keep-Alive
Content-Length : 395
Content-Type : text/html
Date : <string>
ETag : <string>
Keep-Alive : timeout=9999
Last-Modified : <string>
Server : Apache
}
mimeType : text/html
protocol : http/1.1
remoteIPAddress : 127.0.0.1
remotePort : 8443
responseTime : <number>
securityDetails : {
certificateId : 0
certificateTransparencyCompliance : unknown
cipher : AES_128_GCM
encryptedClientHello : false
issuer :
keyExchange :
keyExchangeGroup : X25519
protocol : TLS 1.3
sanList : [
]
serverSignatureAlgorithm : 2052
signedCertificateTimestampList : [
]
subjectName :
validFrom : 1542841725
validTo : 1858201725
}
securityState : insecure
status : 200
statusText : OK
timing : {
connectEnd : -1
connectStart : -1
dnsEnd : -1
dnsStart : -1
proxyEnd : -1
proxyStart : -1
pushEnd : 0
pushStart : 0
receiveHeadersStart : <number>
receiveHeadersEnd : <number>
requestTime : <number>
sendEnd : <number>
sendStart : <number>
sslEnd : -1
sslStart : -1
workerFetchStart : -1
workerReady : -1
workerRespondWithSettled : -1
workerStart : -1
}
url : https://127.0.0.1:8443/inspector-protocol/prefetch/resources/prefetch.https.html?page=2
}
timestamp : <number>
type : Prefetch
}
Network.onResponseReceivedExtraInfo{
blockedCookies : [
]
headers : {
Accept-Ranges : bytes
Connection : Keep-Alive
Content-Length : 395
Content-Type : text/html
Date : <string>
ETag : <string>
Keep-Alive : timeout=9999
Last-Modified : <string>
Server : Apache
}
headersText : <string>
requestId : <string>
resourceIPAddressSpace : Local
statusCode : 200
}
Network.onLoadingFinished{
encodedDataLength : 658
requestId : <string>
timestamp : <number>
}
Prefetch response body{
base64Encoded : false
body : <!DOCTYPE html> <html> <script> let script = document.createElement('script'); script.type = 'speculationrules'; script.textContent = JSON.stringify({ prefetch: [{ source: "list", urls: ["https://127.0.0.1:8443/inspector-protocol/prefetch/resources/prefetch.https.html?page=2"] }] }); document.head.appendChild(script); </script> <body> This is a test page for prefetch! </body> </html>
}