BackgroundIn HTML5, IndexedDB is a way for you to persistently store data inside a user's browser. Because it lets you create web applications with rich query abilities regardless of network availability, your applications can work both online and offline. It is also only supported in more modern browser versions, so it's a ripe target to use as a fingerprint.

How It WorksThis is a rather simple way to determine is the indexedDB method exists. When calling !!window.indexedDB and error will indicate it exists, while no error will indicate it does not exist.

Entropy Estimate: 1 bit

CodeThe JavaScript function below fingerprints the existence of indexedDB for the device. You may also download this code here: TBD. Note: Depending on your output method you may need to URL encode the returned results.

Code

function fp_indexedDB() {

"use strict";

var strOnError, strOut;

strOnError = "<indexedDB>true</indexedDB>";

strOut = "";

try {

strOut = "<indexedDB>" + !!window.indexedDB + "</indexedDB>";

return strOut;

} catch (err) { // Error when referencing it confirms existence

return strOnError;

}

}

ValidationUnlike other code on the Internet we do everything possible to verify our code for you. In order to minimize problems and maximize compatibility this code has been verified with JSLint and has been extensively tested with over 1100 OS/Browser combinations using BrowserStack.