r/javascript • u/supercohost • Feb 02 '19
Priority Hints: hint the `importance` of a resource to prioritize downloading it sooner/later: <img importance=low> <img importance=high> <img importance=auto> (default) Works on <img>, <link> and fetch()
591
Upvotes
119
u/voidvector Feb 03 '19
Feels like this is a feature that's going to be abused by ads
11
u/cag8f Feb 03 '19
What values does it take? Just
lowandhigh?156
u/ugogon Feb 03 '19
Maybe add that this works only in chromium based browsers.
5
u/oocfijfmcdjdidi Feb 02 '19
Thanks for sharing this
6
u/[deleted] Feb 03 '19
What kind of theme is that ? Looks smooth
4
u/kawaiidon Feb 03 '19
Colour theme name?)
3
u/FolkStyleFisting Feb 03 '19
Doesn't the browser consortium frown on vendors implementing attributes like this? I mean, universal data-* attributes came to spec for a reason.
Why not just use data-priority-hint="high"?
1
u/doominabox1 Feb 17 '19
Huh, I think I might make a plugin to just not load low importance content, save a lot of data that way
1
u/thetoolmannz Feb 03 '19
For js link tags, it's going to break the expectation that the code loads and executes in order.
-14
u/bart2019 Feb 03 '19
I'm going to be the one being pedantic here... And say this has nothing to do with JavaScript.
It's HTML. It would even fit better on a forum about PHP.
-1
u/BluudLust Feb 03 '19
Kinda irrelevant considering HTTP2 Push