mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-01-09 15:47:55 -05:00
* Convert jsdoc HTTP to HTTPS (#2338) Convert http -> https in JSDocs. * Finish checking http hyperlinks in jsDocs - Links in jsDocs that are working but do not have HTTPS are left as is. - Dead links are replaced with archived links if obtainable, otherwise new links with similar information. * Fixes to some HTTPS Links - Fixing comments - Pointing to archived links - Replacing with new links * Fixing HTTPS:// links in jsDocs - Unify WFC comment name - Change some links to new redirected links - Change some links to acrhived links * Changing old links to new redirected links * Updates for pull request - Fix missing square bracket - Update generic names (i.e. WHATWG, MDN, Html5 Rocks) - Update archive links to most recent working links - Point link to direct issue for oninput.js
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
/*!
|
|
{
|
|
"name": "Geolocation API",
|
|
"property": "geolocation",
|
|
"caniuse": "geolocation",
|
|
"tags": ["media"],
|
|
"notes": [{
|
|
"name": "MDN Docs",
|
|
"href": "https://developer.mozilla.org/en-US/docs/WebAPI/Using_geolocation"
|
|
}],
|
|
"polyfills": [
|
|
"joshuabell-polyfill",
|
|
"webshims",
|
|
"geo-location-javascript",
|
|
"geolocation-api-polyfill"
|
|
]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Detects support for the Geolocation API for users to provide their location to web applications.
|
|
*/
|
|
define(['Modernizr'], function(Modernizr) {
|
|
// geolocation is often considered a trivial feature detect...
|
|
// Turns out, it's quite tricky to get right:
|
|
//
|
|
// Using !!navigator.geolocation does two things we don't want. It:
|
|
// 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
|
|
// 2. Disables page caching in WebKit: webk.it/43956
|
|
//
|
|
// Meanwhile, in Firefox < 8, an about:config setting could expose
|
|
// a false positive that would throw an exception: bugzil.la/688158
|
|
|
|
Modernizr.addTest('geolocation', 'geolocation' in navigator);
|
|
});
|