1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Bring fingerprint2.js scriptlet up to date

Related issue:
- https://github.com/uBlockOrigin/uAssets/pull/4961
This commit is contained in:
Raymond Hill 2020-04-18 09:45:07 -04:00
parent db5967731d
commit d95b27915f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1156,11 +1156,17 @@
// https://github.com/uBlockOrigin/uAssets/issues/2912
/// fingerprint2.js
(function() {
let fp2 = function(){};
let browserId = '';
for ( let i = 0; i < 8; i++ ) {
browserId += (Math.random() * 0x10000 + 0x1000 | 0).toString(16).slice(-4);
}
const fp2 = function(){};
fp2.get = function(opts, cb) {
if ( !cb ) { cb = opts; }
setTimeout(( ) => { cb(browserId, []); }, 1);
};
fp2.prototype = {
get: function(cb) {
setTimeout(function() { cb('', []); }, 1);
}
get: fp2.get
};
window.Fingerprint2 = fp2;
})();