| 1 | return 'IntersectionObserver' in window && |
| 2 | typeof fetch === 'function' && |
| 3 | // Ensure: |
| 4 | // - standards compliant URL |
| 5 | // - standards compliant URLSearchParams |
| 6 | // - URL#toJSON method (came later) |
| 7 | // |
| 8 | // Facts: |
| 9 | // - All browsers with URL also have URLSearchParams, don't need to check. |
| 10 | // - Safari <= 7 and Chrome <= 31 had a buggy URL implementations. |
| 11 | // - Firefox 29-43 had an incomplete URLSearchParams implementation. https://caniuse.com/urlsearchparams |
| 12 | // - URL#toJSON was released in Firefox 54, Safari 11, and Chrome 71. https://caniuse.com/mdn-api_url_tojson |
| 13 | // Thus we don't need to check for buggy URL or incomplete URLSearchParams. |
| 14 | typeof URL === 'function' && 'toJSON' in URL.prototype; |