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