Repository: Modernizr/Modernizr (js)

Issue:
Rel Prefetch Support?
Any chance we could get a detect for rel prefetch? It'd be super-helpful for WebKit browsers. There's a [bug out for it](https://bugs.webkit.org/show_bug.cgi?id=194539) now, but no movement yet.

Pull request description:
Add detect/tests for prefetch
Closes #2536

- Made a detect for prefetch based on https://github.com/w3c/preload/issues/7
- Added general test and caniuse test

Patch:
diff --git a/feature-detects/link/prefetch.js b/feature-detects/link/prefetch.js
new file mode 100644
index 00000000..66e0b4b0
--- /dev/null
+++ b/feature-detects/link/prefetch.js
@@ -0,0 +1,33 @@
+/*!
+{
+  "name": "rel=prefetch",
+  "property": "prefetch",
+  "caniuse": "link-rel-prefetch",
+  "notes": [{
+    "name": "W3C Spec",
+    "href": "https://www.w3.org/TR/resource-hints/#prefetch"
+  }, {
+    "name": "Related Github Issue",
+    "href": "https://github.com/Modernizr/Modernizr/issues/2536"
+  }]
+}
+!*/
+/* DOC
+Test for resource hints: prefetch.
+*/
+define(["Modernizr", "createElement"], function (Modernizr, createElement) {
+  Modernizr.addTest("prefetch", function() {
+    if (document.documentMode === 11) {
+      // Need to check specifically for IE11 as it supports prefetch, but not relList
+      // https://github.com/Modernizr/Modernizr/pull/2610#issuecomment-709717161
+      return true;
+    }
+
+    var relList = createElement("link").relList;
+    if (!relList || !relList.supports) {
+      return false;
+    }
+
+    return relList.supports("prefetch");
+  });
+});
diff --git a/lib/config-all.json b/lib/config-all.json
index afa6afa5..5dc9ae5d 100644
--- a/lib/config-all.json
+++ b/lib/config-all.json
@@ -264,6 +264,7 @@
     "proxy",
     "queryselector",
     "quota-management-api",
+    "link/prefetch",
     "requestanimationframe",
     "script/async",
     "script/defer",


Test patch:
diff --git a/test/browser/integration/caniuse.js b/test/browser/integration/caniuse.js
index c4fabe10..57ce81b4 100644
--- a/test/browser/integration/caniuse.js
+++ b/test/browser/integration/caniuse.js
@@ -124,6 +124,7 @@ window.caniusecb = function(caniuse) {
       picture: 'picture',
       pointerevents: 'pointer',
       postmessage: 'x-doc-messaging',
+      prefetch: 'link-rel-prefetch',
       progressbar: 'progress',
       promises: 'promises',
       proximity: 'proximity',