Generalize the EarlyHintPreloader to cover more assets
Categories
(Core :: Networking: HTTP, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: manuel, Assigned: manuel)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(4 files)
Currently the EarlyHintPreloader from Bug 1753730 only covers images. This bug is about generalizing it to cover other assets from /dom/html/HTMLLinkElement.cpp#443-448
This will be done in two patches:
- extract the parsing of HTMLLinkElement::ParseAsValue and expose it in nsNetUtil.h
- use the ParseAsValue function in the EarlyHintPreloader and configure the channel depending on the asset type
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
Depends on D141760
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D142201
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
Parsing the script type from the Link header is still missing from the generic preloader (notes to self for later):
- module load
- normal load
- NewChannel (called in both modes)
- Difference in security flags
Comment 6•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
Depends on D139740
Assignee | ||
Comment 8•3 years ago
|
||
Question that came up when working on D139740. Anne, can you clear me up there?
Not sure if there is something incorrect here (or I don't understand the code yet):
- nsILoadInfo.idl#117-123:
SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL
is used to disable CORS checks - FetchPreloader.cpp#88-91: FetchPreloader sets this flag on
aCORSMode == CORS_NONE
- PreloadService.cpp#225, Element.cpp#3389-3392:
CORS_NONE
is set, when the preload doesn't specify a cors mode - In my understanding Fetches should always sent CORS (preflight?) requests. So why are fetch preloads without CORS allowed (or what is it I'm not understanding yet)?
Comment 9•3 years ago
|
||
It is supposed to depend on whether or not the crossorigin
attribute on the Link
header is present. As I understand it Early Hints integration with the web platform is detailed in https://html.spec.whatwg.org/#early-hints (and there's a part in https://fetch.spec.whatwg.org/ for returning the 103 responses to the caller). Have you checked with those algorithms?
As I understand them, that can mean the request mode can end up being "no-cors
" (in terms of Fetch), which is somewhat okay as the preloaded resource might be for an img
element without a crossorigin
attribute, which would also end up doing a "no-cors
" request. Hope that helps.
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
Backed out 5 changesets (bug 1761242, bug 1744822, bug 1761252) for causing browser-chrome failures in netwerk/test/browser/browser_103_assets.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/d8e2d67cb443903c2fd609832b1395597ef843c1
INFO - Buffered messages finished
[task 2022-06-08T15:51:36.858Z] 15:51:36 INFO - TEST-UNEXPECTED-FAIL | netwerk/test/browser/browser_103_assets.js | test_103_asset_normal (fetch): Unexpected amount of requests made - {"hinted":0,"normal":0} deepEqual {"hinted":0,"normal":1} - JS frame :: chrome://mochitests/content/browser/netwerk/test/browser/browser_103_assets.js :: test_hint_asset :: line 32
[task 2022-06-08T15:51:36.858Z] 15:51:36 INFO - Stack trace:
[task 2022-06-08T15:51:36.858Z] 15:51:36 INFO - chrome://mochitests/content/browser/netwerk/test/browser/browser_103_assets.js:test_hint_asset:32
[task 2022-06-08T15:51:36.859Z] 15:51:36 INFO - Leaving test bound test_103_asset_fetch
Assignee | ||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
bugherder |
Assignee | ||
Updated•2 years ago
|
Description
•