Closed getify closed 8 years ago
created separate issue "spec shuold mention that relList must also be implemented if preload is implemented" #126 or feel free to close that and reopen this one.
here is a simpler version of @yoavweiss's snippet (https://gist.github.com/yoavweiss/8490dabb3e0aa112fc74) tailored just for this specific use case
function preloadSupported() {
var relList = document.createElement('link').relList;
return !!(relList && relList.supports && relList.supports('preload'));
}
given that there is no need for try/catch for this case (as he confirmed). Worked, and did not throw in any browser I tested with (IE 10+, safari 10.1+, chrome 50+, firefox 50+, edge 15+)
How do I feature test if a new browser supports
link rel=preload
?