The library supports all popular browsers. We use the following command to determine which browsers to support:
npx browserslist "cover 96% in us, not IE < 11"
At the moment, these browsers are:
- Internet Explorer 11 (see the section below)
- Edge 93+
- Chrome 49+
- Firefox 52+
- Desktop Safari 12.1+
- Mobile Safari 10.3+
- Samsung Internet 14.0+
- Android Browser 4.4+ (see the section below)
Other browsers will probably also work, but we don't guarantee it.
If you use the "Browser ECMAScript module" installation methods, you may have an error.
Old browsers don't support import.
Replace it with a <script>
tag:
+ // Note that we use iife.min.js with older browsers
+ <script src="https://openfpcdn.io/fingerprintjs/v3/iife.min.js"></script>
<script>
- const fpPromise = import('https://openfpcdn.io/fingerprintjs/v3')
- .then(FingerprintJS => FingerprintJS.load())
+ var fpPromise = FingerprintJS.load()
// ...
</script>
Very old browsers like Internet Explorer 11 and Android Browser 4.4 require a Promise polyfill to work. Add a Promise polyfill before loading the FingerprintJS agent. Examples for various installation methods:
+ <script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
<script src="https://openfpcdn.io/fingerprintjs/v3/iife.min.js"></script>
<script>
var fpPromise = FingerprintJS.load()
// ...
</script>
require(
[
'https://openfpcdn.io/fingerprintjs/v3/umd.min.js',
+ 'https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js',
],
function (FingerprintJS) {
// ...
}
)
# Install the polyfill package first:
npm i promise-polyfill
# or
yarn add promise-polyfill
+ import 'promise-polyfill/src/polyfill'
import FingerprintJS from '@fingerprintjs/fingerprintjs'
// ...
An outdated CommonJS syntax:
+ require('promise-polyfill/src/polyfill')
const FingerprintJS = require('@fingerprintjs/fingerprintjs')
// ...
Old browsers like IE11 don't support const
, let
and arrow functions (=>
).
Use var
and the classic function syntax instead:
- const fpPromise = FingerprintJS.load()
+ var fpPromise = FingerprintJS.load()
fpPromise
- .then(fp => fp.get())
+ .then(function (fp) { return fp.get() })
- .then(result => {
+ .then(function (result) {
// Handle the result
})