3.3.0 • Published 2 years ago
mable-fingerprint v3.3.0
mable-fingerprint
Steps to initalize
import mflib from "<path_to_mable-fingerprinting-lib>"
// 1. create an object
const mfo = new mflib();
// 2. *Must initalize* the object
// init function returns a promise
await mfo.init()
Methods to use on the object
getFingerprintComponents
- return all the data collected from the browser
getPossibleComponents()
- returns a list of all fields that can be queryed
getCustomComponents(Array)
- return the subset of data collected
Example usage
try {
const mfo = new mflib();
await mfo.init();
this.deviceData = await mfo.getFingerprintComponents();
console.log(this.deviceData);
console.log(mfo.getPossibleComponents())
console.log(mfo.getCustomComponents(["os", "device"]))
const combination: fingerprintFields = [
"platform",
"colorDepth",
"availableResolution",
"timezone"]
const mh = await mfo.generateMableFingerprint(combination);
this.mableHash = mh;
} catch (err) {
console.log("mable-lib error" + err);
}
Type Def
export interface IFingerprint {
incognito?: bool,
browserName?: str,
browserVersion?: str,
location?: any,
osVersion?: str,
platform?: str,
deviceMemory?: num,
ua?: str,
browser?: any,
engine?: any,
os?: any,
device?: any,
cpu?: any,
adBlockEnabled?: bool,
screenPrint?: str,
colorDepth?: num,
availableResolution?: str,
hardwareConcurrency?: num,
}
Develop FAQ
How to bump up a version
npm version patch
npm publish