mirror of https://github.com/gorhill/uBlock.git
Bring fingerprint2.js scriptlet up to date
Related issue: - https://github.com/uBlockOrigin/uAssets/pull/4961
This commit is contained in:
parent
db5967731d
commit
d95b27915f
|
@ -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;
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue