fpscanner 0.9.2 â 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fpScanner.cjs.js +2 -2
- package/dist/fpScanner.es.js +16 -13
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/scripts/build-custom.js +55 -37
- package/scripts/verify-publish.js +54 -0
- package/src/index.ts +11 -0
package/dist/fpScanner.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function te(){return navigator.webdriver}function re(){return navigator.userAgent}function ne(){return navigator.platform}const l="ERROR",r="INIT",s="NA",p="SKIPPED",h="high",ie="low",ae="medium";function d(t){let e=0;for(let n=0,a=t.length;n<a;n++){let i=t.charCodeAt(n);e=(e<<5)-e+i,e|=0}return e.toString(16).padStart(8,"0")}function g(t,e){for(const n in t)t[n]=e}function oe(){return navigator.buildID==="20181001000000"}function se(){try{let t=!1;const e=Error.prepareStackTrace;Error.prepareStackTrace=function(){return t=!0,e};const n=new Error("");return console.log(n),t}catch{return l}}function ce(){const t={vendor:r,renderer:r};if(oe())return g(t,s),t;try{var e=document.createElement("canvas"),n=e.getContext("webgl")||e.getContext("experimental-webgl");n.getSupportedExtensions().indexOf("WEBGL_debug_renderer_info")>=0?(t.vendor=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_VENDOR_WEBGL),t.renderer=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)):g(t,s)}catch{g(t,l)}return t}function le(){return"__pwInitScripts"in window||"__playwright__binding__"in window}function ue(){return navigator.hardwareConcurrency||s}function de(){const t=[],e=.123456789;return["E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"].forEach(function(i){try{t.push(Math[i])}catch{t.push(-1)}}),["tan","sin","exp","atan","acosh","asinh","atanh","expm1","log1p","sinh"].forEach(function(i){try{t.push(Math[i](e))}catch{t.push(-1)}}),d(t.map(String).join(","))}function ge(){return navigator.deviceMemory||s}function he(){return eval.toString().length}function me(){const t={timezone:r,localeLanguage:r};try{if(typeof Intl<"u"&&typeof Intl.DateTimeFormat<"u"){const e=Intl.DateTimeFormat().resolvedOptions();t.timezone=e.timeZone,t.localeLanguage=e.locale}else t.timezone=s,t.localeLanguage=s}catch{t.timezone=l,t.localeLanguage=l}return t}function pe(){return{width:window.screen.width,height:window.screen.height,pixelDepth:window.screen.pixelDepth,colorDepth:window.screen.colorDepth,availableWidth:window.screen.availWidth,availableHeight:window.screen.availHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight,hasMultipleDisplays:typeof screen.isExtended<"u"?screen.isExtended:s}}function fe(){return{languages:navigator.languages,language:navigator.language}}async function ve(){const t={vendor:r,architecture:r,device:r,description:r};if("gpu"in navigator)try{const e=await navigator.gpu.requestAdapter();e&&(t.vendor=e.info.vendor,t.architecture=e.info.architecture,t.device=e.info.device,t.description=e.info.description)}catch{g(t,l)}else g(t,s);return t}function ye(){const t=["__driver_evaluate","__webdriver_evaluate","__selenium_evaluate","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__selenium_unwrapped","__fxdriver_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium","$cdc_asdjflasutopfhvcZLmcfl_","$chrome_asyncScriptInfo","__$webdriverAsyncExecutor","webdriver","__webdriverFunc","domAutomation","domAutomationController","__lastWatirAlert","__lastWatirConfirm","__lastWatirPrompt","__webdriver_script_fn","_WEBDRIVER_ELEM_CACHE"];let e=!1;for(let n=0;n<t.length;n++)if(t[n]in window){e=!0;break}return e=e||!!document.__webdriver_script_fn||!!window.domAutomation||!!window.domAutomationController,e}function we(){try{const t="webdriver",e=window.navigator;if(!e[t]&&!e.hasOwnProperty(t)){e[t]=1;const n=e[t]===1;return delete e[t],n}return!0}catch{return!1}}async function be(){const t=window.navigator,e={architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r};if("userAgentData"in t)try{const n=await t.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion"]);e.architecture=n.architecture,e.bitness=n.bitness,e.brands=n.brands,e.mobile=n.mobile,e.model=n.model,e.platform=n.platform,e.platformVersion=n.platformVersion,e.uaFullVersion=n.uaFullVersion}catch{g(e,l)}else g(e,s);return e}function Se(){if(!navigator.plugins)return!1;const t=typeof navigator.plugins.toString=="function"?navigator.plugins.toString():navigator.plugins.constructor&&typeof navigator.plugins.constructor.toString=="function"?navigator.plugins.constructor.toString():typeof navigator.plugins;return t==="[object PluginArray]"||t==="[object MSPluginsCollection]"||t==="[object HTMLPluginsCollection]"}function Ce(){if(!navigator.plugins)return s;const t=[];for(let e=0;e<navigator.plugins.length;e++)t.push(navigator.plugins[e].name);return d(t.join(","))}function We(){return navigator.plugins?navigator.plugins.length:s}function ke(){if(!navigator.plugins)return s;try{return navigator.plugins[0]===navigator.plugins[0][0].enabledPlugin}catch{return l}}function Ee(){if(!navigator.plugins)return s;try{return navigator.plugins.item(4294967296)!==navigator.plugins[0]}catch{return l}}function Ae(){const t={isValidPluginArray:r,pluginCount:r,pluginNamesHash:r,pluginConsistency1:r,pluginOverflow:r};try{t.isValidPluginArray=Se(),t.pluginCount=We(),t.pluginNamesHash=Ce(),t.pluginConsistency1=ke(),t.pluginOverflow=Ee()}catch{g(t,l)}return t}async function
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function te(){return navigator.webdriver}function re(){return navigator.userAgent}function ne(){return navigator.platform}const l="ERROR",r="INIT",s="NA",p="SKIPPED",h="high",ie="low",ae="medium";function d(t){let e=0;for(let n=0,a=t.length;n<a;n++){let i=t.charCodeAt(n);e=(e<<5)-e+i,e|=0}return e.toString(16).padStart(8,"0")}function g(t,e){for(const n in t)t[n]=e}function oe(){return navigator.buildID==="20181001000000"}function se(){try{let t=!1;const e=Error.prepareStackTrace;Error.prepareStackTrace=function(){return t=!0,e};const n=new Error("");return console.log(n),t}catch{return l}}function ce(){const t={vendor:r,renderer:r};if(oe())return g(t,s),t;try{var e=document.createElement("canvas"),n=e.getContext("webgl")||e.getContext("experimental-webgl");n.getSupportedExtensions().indexOf("WEBGL_debug_renderer_info")>=0?(t.vendor=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_VENDOR_WEBGL),t.renderer=n.getParameter(n.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)):g(t,s)}catch{g(t,l)}return t}function le(){return"__pwInitScripts"in window||"__playwright__binding__"in window}function ue(){return navigator.hardwareConcurrency||s}function de(){const t=[],e=.123456789;return["E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"].forEach(function(i){try{t.push(Math[i])}catch{t.push(-1)}}),["tan","sin","exp","atan","acosh","asinh","atanh","expm1","log1p","sinh"].forEach(function(i){try{t.push(Math[i](e))}catch{t.push(-1)}}),d(t.map(String).join(","))}function ge(){return navigator.deviceMemory||s}function he(){return eval.toString().length}function me(){const t={timezone:r,localeLanguage:r};try{if(typeof Intl<"u"&&typeof Intl.DateTimeFormat<"u"){const e=Intl.DateTimeFormat().resolvedOptions();t.timezone=e.timeZone,t.localeLanguage=e.locale}else t.timezone=s,t.localeLanguage=s}catch{t.timezone=l,t.localeLanguage=l}return t}function pe(){return{width:window.screen.width,height:window.screen.height,pixelDepth:window.screen.pixelDepth,colorDepth:window.screen.colorDepth,availableWidth:window.screen.availWidth,availableHeight:window.screen.availHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight,hasMultipleDisplays:typeof screen.isExtended<"u"?screen.isExtended:s}}function fe(){return{languages:navigator.languages,language:navigator.language}}async function ve(){const t={vendor:r,architecture:r,device:r,description:r};if("gpu"in navigator)try{const e=await navigator.gpu.requestAdapter();e&&(t.vendor=e.info.vendor,t.architecture=e.info.architecture,t.device=e.info.device,t.description=e.info.description)}catch{g(t,l)}else g(t,s);return t}function ye(){const t=["__driver_evaluate","__webdriver_evaluate","__selenium_evaluate","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__selenium_unwrapped","__fxdriver_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium","$cdc_asdjflasutopfhvcZLmcfl_","$chrome_asyncScriptInfo","__$webdriverAsyncExecutor","webdriver","__webdriverFunc","domAutomation","domAutomationController","__lastWatirAlert","__lastWatirConfirm","__lastWatirPrompt","__webdriver_script_fn","_WEBDRIVER_ELEM_CACHE"];let e=!1;for(let n=0;n<t.length;n++)if(t[n]in window){e=!0;break}return e=e||!!document.__webdriver_script_fn||!!window.domAutomation||!!window.domAutomationController,e}function we(){try{const t="webdriver",e=window.navigator;if(!e[t]&&!e.hasOwnProperty(t)){e[t]=1;const n=e[t]===1;return delete e[t],n}return!0}catch{return!1}}async function be(){const t=window.navigator,e={architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r};if("userAgentData"in t)try{const n=await t.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion"]);e.architecture=n.architecture,e.bitness=n.bitness,e.brands=n.brands,e.mobile=n.mobile,e.model=n.model,e.platform=n.platform,e.platformVersion=n.platformVersion,e.uaFullVersion=n.uaFullVersion}catch{g(e,l)}else g(e,s);return e}function Se(){if(!navigator.plugins)return!1;const t=typeof navigator.plugins.toString=="function"?navigator.plugins.toString():navigator.plugins.constructor&&typeof navigator.plugins.constructor.toString=="function"?navigator.plugins.constructor.toString():typeof navigator.plugins;return t==="[object PluginArray]"||t==="[object MSPluginsCollection]"||t==="[object HTMLPluginsCollection]"}function Ce(){if(!navigator.plugins)return s;const t=[];for(let e=0;e<navigator.plugins.length;e++)t.push(navigator.plugins[e].name);return d(t.join(","))}function We(){return navigator.plugins?navigator.plugins.length:s}function ke(){if(!navigator.plugins)return s;try{return navigator.plugins[0]===navigator.plugins[0][0].enabledPlugin}catch{return l}}function Ee(){if(!navigator.plugins)return s;try{return navigator.plugins.item(4294967296)!==navigator.plugins[0]}catch{return l}}function Ae(){const t={isValidPluginArray:r,pluginCount:r,pluginNamesHash:r,pluginConsistency1:r,pluginOverflow:r};try{t.isValidPluginArray=Se(),t.pluginCount=We(),t.pluginNamesHash=Ce(),t.pluginConsistency1=ke(),t.pluginOverflow=Ee()}catch{g(t,l)}return t}async function xe(){return new Promise(async function(t){var e={audiooutput:0,audioinput:0,videoinput:0};if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices){const i=await navigator.mediaDevices.enumerateDevices();if(typeof i<"u"){for(var n=0;n<i.length;n++){var a=i[n].kind;e[a]=e[a]+1}return t({speakers:e.audiooutput,microphones:e.audioinput,webcams:e.videoinput})}else return g(e,s),t(e)}else return g(e,s),t(e)})}function Pe(){const t={webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r},e=document.createElement("iframe");try{e.style.display="none",e.src="about:blank",document.body.appendChild(e);const n=e.contentWindow?.navigator;t.webdriver=n.webdriver??!1,t.userAgent=n.userAgent??s,t.platform=n.platform??s,t.memory=n.deviceMemory??s,t.cpuCount=n.hardwareConcurrency??s,t.language=n.language??s}catch{g(t,l)}finally{document.body.removeChild(e)}return t}async function De(){return new Promise(t=>{const e={vendor:r,renderer:r,userAgent:r,language:r,platform:r,memory:r,cpuCount:r};try{const n=`try {
|
|
2
2
|
var fingerprintWorker = {};
|
|
3
3
|
|
|
4
4
|
fingerprintWorker.userAgent = navigator.userAgent;
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
self.postMessage(fingerprintWorker);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
self.postMessage(fingerprintWorker);
|
|
31
|
-
}`,a=new Blob([n],{type:"application/javascript"}),i=URL.createObjectURL(a),m=new Worker(i);m.onmessage=function(u){try{return e.vendor=u.data.vendor,e.renderer=u.data.renderer,e.userAgent=u.data.userAgent,e.language=u.data.language,e.platform=u.data.platform,e.memory=u.data.memory,e.cpuCount=u.data.cpuCount,t(e)}catch{return g(e,l),t(e)}}}catch{return g(e,l),t(e)}})}function Me(){const t={toSourceError:r,hasToSource:!1};try{null.usdfsh}catch(e){t.toSourceError=e.toString()}try{throw"xyz"}catch(e){try{e.toSource(),t.hasToSource=!0}catch{t.hasToSource=!1}}return t}const w=['audio/mp4; codecs="mp4a.40.2"',"audio/mpeg;",'audio/webm; codecs="vorbis"','audio/ogg; codecs="vorbis"','audio/wav; codecs="1"','audio/ogg; codecs="speex"','audio/ogg; codecs="flac"','audio/3gpp; codecs="samr"'],b=['video/mp4; codecs="avc1.42E01E, mp4a.40.2"','video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc1.58A01E"','video/mp4; codecs="avc1.4D401E"','video/mp4; codecs="avc1.64001E"','video/mp4; codecs="mp4v.20.8"','video/mp4; codecs="mp4v.20.240"','video/webm; codecs="vp8"','video/ogg; codecs="theora"','video/ogg; codecs="dirac"','video/3gpp; codecs="mp4v.20.8"','video/x-matroska; codecs="theora"'];function S(t,e){const n={};try{const a=document.createElement(e);for(const i of t)try{n[i]=a.canPlayType(i)||null}catch{n[i]=null}}catch{for(const a of t)n[a]=null}return n}function C(t){const e={},n=window.MediaSource;if(!n||typeof n.isTypeSupported!="function"){for(const a of t)e[a]=null;return e}for(const a of t)try{e[a]=n.isTypeSupported(a)}catch{e[a]=null}return e}function W(t){try{const e=window.RTCRtpReceiver;if(e&&typeof e.getCapabilities=="function"){const n=e.getCapabilities(t);return d(JSON.stringify(n))}return s}catch{return l}}function _e(){const t={audioCanPlayTypeHash:s,videoCanPlayTypeHash:s,audioMediaSourceHash:s,videoMediaSourceHash:s,rtcAudioCapabilitiesHash:s,rtcVideoCapabilitiesHash:s,hasMediaSource:!1};try{t.hasMediaSource=!!window.MediaSource;const e=S(w,"audio"),n=S(b,"video");t.audioCanPlayTypeHash=d(JSON.stringify(e)),t.videoCanPlayTypeHash=d(JSON.stringify(n));const a=C(w),i=C(b);t.audioMediaSourceHash=d(JSON.stringify(a)),t.videoMediaSourceHash=d(JSON.stringify(i)),t.rtcAudioCapabilitiesHash=W("audio"),t.rtcVideoCapabilitiesHash=W("video")}catch{g(t,l)}return t}async function Re(){return new Promise(t=>{try{const e=new Image,n=document.createElement("canvas").getContext("2d");e.onload=()=>{n.drawImage(e,0,0),t(n.getImageData(0,0,1,1).data.filter(a=>a===0).length!=4)},e.onerror=()=>{t(l)},e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}catch{t(l)}})}function Te(){var t=document.createElement("canvas");t.width=400,t.height=200,t.style.display="inline";var e=t.getContext("2d");try{return e.rect(0,0,10,10),e.rect(2,2,6,6),e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.font="11pt no-real-font-123",e.fillText("Cwm fjordbank glyphs vext quiz, đ",2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText("Cwm fjordbank glyphs vext quiz, đ",4,45),e.globalCompositeOperation="multiply",e.fillStyle="rgb(255,0,255)",e.beginPath(),e.arc(50,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(0,255,255)",e.beginPath(),e.arc(100,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,255,0)",e.beginPath(),e.arc(75,100,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,0,255)",e.arc(75,75,75,0,2*Math.PI,!0),e.arc(75,75,25,0,2*Math.PI,!0),e.fill("evenodd"),d(t.toDataURL())}catch{return l}}async function Ie(){const t={hasModifiedCanvas:r,canvasFingerprint:r};return t.hasModifiedCanvas=await Re(),t.canvasFingerprint=Te(),t}function He(){const t=["deviceMemory","hardwareConcurrency","language","languages","platform"],e=[];for(const n of t){const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator),n);a&&a.value?e.push("1"):e.push("0")}return e.join("")}function Oe(){return Math.random().toString(36).substring(2,15)}function Le(){return new Date().getTime()}function Ve(){return window.location.href}function k(t,e){const n=t.signals;return e==="iframe"?n.contexts.iframe.webdriver!==n.automation.webdriver||n.contexts.iframe.userAgent!==n.browser.userAgent||n.contexts.iframe.platform!==n.device.platform||n.contexts.iframe.memory!==n.device.memory||n.contexts.iframe.cpuCount!==n.device.cpuCount:n.contexts.webWorker.webdriver!==n.automation.webdriver||n.contexts.webWorker.userAgent!==n.browser.userAgent||n.contexts.webWorker.platform!==n.device.platform||n.contexts.webWorker.memory!==n.device.memory||n.contexts.webWorker.cpuCount!==n.device.cpuCount}function je(){const t={bitmask:r,extensions:[]},e=document.body.hasAttribute("data-gr-ext-installed"),n=typeof window.ethereum<"u",a=document.getElementById("coupon-birds-drop-div")!==null,i=document.querySelector("deepl-input-controller")!==null,m=document.getElementById("monica-content-root")!==null,u=document.querySelector("chatgpt-sidebar")!==null,v=typeof window.__REQUESTLY__<"u",o=Array.from(document.querySelectorAll("*")).filter(f=>f.tagName.toLowerCase().startsWith("veepn-")).length>0;return t.bitmask=[e?"1":"0",n?"1":"0",a?"1":"0",i?"1":"0",m?"1":"0",u?"1":"0",v?"1":"0",o?"1":"0"].join(""),e&&t.extensions.push("grammarly"),n&&t.extensions.push("metamask"),a&&t.extensions.push("coupon-birds"),i&&t.extensions.push("deepl"),m&&t.extensions.push("monica-ai"),u&&t.extensions.push("sider-ai"),v&&t.extensions.push("requestly"),o&&t.extensions.push("veepn"),t}function Ge(){const t={bitmask:r,chrome:"chrome"in window,brave:"brave"in navigator,applePaySupport:"ApplePaySetup"in window,opera:typeof window.opr<"u"||typeof window.onoperadetachedviewchange=="object",serial:window.navigator.serial!==void 0,attachShadow:!!Element.prototype.attachShadow,caches:!!window.caches,webAssembly:!!window.WebAssembly&&!!window.WebAssembly.instantiate,buffer:"Buffer"in window,showModalDialog:"showModalDialog"in window},e=Object.keys(t).filter(n=>n!=="bitmask").map(n=>t[n]?"1":"0").join("");return t.bitmask=e,t}function Ne(){const t={prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r};try{window.matchMedia("(prefers-color-scheme: dark)").matches?t.prefersColorScheme="dark":window.matchMedia("(prefers-color-scheme: light)").matches?t.prefersColorScheme="light":t.prefersColorScheme=null,t.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,t.prefersReducedTransparency=window.matchMedia("(prefers-reduced-transparency: reduce)").matches,window.matchMedia("(color-gamut: rec2020)").matches?t.colorGamut="rec2020":window.matchMedia("(color-gamut: p3)").matches?t.colorGamut="p3":window.matchMedia("(color-gamut: srgb)").matches?t.colorGamut="srgb":t.colorGamut=null,window.matchMedia("(pointer: fine)").matches?t.pointer="fine":window.matchMedia("(pointer: coarse)").matches?t.pointer="coarse":window.matchMedia("(pointer: none)").matches?t.pointer="none":t.pointer=null,window.matchMedia("(any-pointer: fine)").matches?t.anyPointer="fine":window.matchMedia("(any-pointer: coarse)").matches?t.anyPointer="coarse":window.matchMedia("(any-pointer: none)").matches?t.anyPointer="none":t.anyPointer=null,t.hover=window.matchMedia("(hover: hover)").matches,t.anyHover=window.matchMedia("(any-hover: hover)").matches;let e=0;for(let n=0;n<=16;n++)window.matchMedia(`(color: ${n})`).matches&&(e=n);t.colorDepth=e}catch{g(t,l)}return t}function Be(t){const e=t.signals.device.screenResolution;return typeof e.width!="number"||typeof e.height!="number"?!1:e.width===600&&e.height===800||e.availableWidth===600&&e.availableHeight===800||e.innerWidth===600&&e.innerHeight===800}function Fe(t){return t.signals.automation.webdriver===!0}function ze(t){return!!t.signals.automation.selenium}function Ue(t){return t.signals.automation.cdp===!0}function $e(t){return t.signals.automation.playwright===!0}function Qe(t){return typeof t.signals.device.memory!="number"?!1:t.signals.device.memory>8||t.signals.device.memory<.25}function Ke(t){return typeof t.signals.device.cpuCount!="number"?!1:t.signals.device.cpuCount>70}function qe(t){const e=t.signals.browser.userAgent;return t.signals.browser.features.chrome===!1&&typeof e=="string"&&e.includes("Chrome")}function Je(t){return t.signals.contexts.iframe.webdriver===!0}function Ye(t){return t.signals.contexts.webWorker.webdriver===!0}function Ze(t){const e=t.signals.contexts.webWorker,n=t.signals.graphics.webGL;return e.vendor===l||e.renderer===l||n.vendor===s||n.renderer===s||e.vendor===p?!1:e.vendor!==n.vendor||e.renderer!==n.renderer}function Xe(t){return t.signals.contexts.webWorker.platform===s||t.signals.contexts.webWorker.platform===l||t.signals.contexts.webWorker.platform===p?!1:t.signals.device.platform!==t.signals.contexts.webWorker.platform}function et(t){return t.signals.contexts.iframe.platform===s||t.signals.contexts.iframe.platform===l?!1:t.signals.device.platform!==t.signals.contexts.iframe.platform}function tt(t){return t.signals.automation.webdriverWritable===!0}function rt(t){return t.signals.graphics.webGL.renderer.includes("SwiftShader")}function nt(t){return t.signals.locale.internationalization.timezone==="UTC"}async function it(t,e){const n=new TextEncoder().encode(e),a=new TextEncoder().encode(t),i=new Uint8Array(a.length);for(let u=0;u<a.length;u++)i[u]=a[u]^n[u%n.length];const m=String.fromCharCode(...i);return btoa(m)}class at{constructor(){this.fingerprint={signals:{automation:{webdriver:r,webdriverWritable:r,selenium:r,cdp:r,playwright:r,navigatorPropertyDescriptors:r},device:{cpuCount:r,memory:r,platform:r,screenResolution:{width:r,height:r,pixelDepth:r,colorDepth:r,availableWidth:r,availableHeight:r,innerWidth:r,innerHeight:r,hasMultipleDisplays:r},multimediaDevices:{speakers:r,microphones:r,webcams:r},mediaQueries:{prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r}},browser:{userAgent:r,features:{bitmask:r,chrome:r,brave:r,applePaySupport:r,opera:r,serial:r,attachShadow:r,caches:r,webAssembly:r,buffer:r,showModalDialog:r},plugins:{isValidPluginArray:r,pluginCount:r,pluginNamesHash:r,pluginConsistency1:r,pluginOverflow:r},extensions:{bitmask:r,extensions:r},highEntropyValues:{architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r},etsl:r,maths:r,toSourceError:{toSourceError:r,hasToSource:r}},graphics:{webGL:{vendor:r,renderer:r},webgpu:{vendor:r,architecture:r,device:r,description:r},canvas:{hasModifiedCanvas:r,canvasFingerprint:r}},codecs:{audioCanPlayTypeHash:r,videoCanPlayTypeHash:r,audioMediaSourceHash:r,videoMediaSourceHash:r,rtcAudioCapabilitiesHash:r,rtcVideoCapabilitiesHash:r,hasMediaSource:r},locale:{internationalization:{timezone:r,localeLanguage:r},languages:{languages:r,language:r}},contexts:{iframe:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r},webWorker:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r,vendor:r,renderer:r}}},fsid:r,nonce:r,time:r,url:r,fastBotDetection:!1,fastBotDetectionDetails:{headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}}}}async collectSignal(e){try{return await e()}catch{return l}}generateFingerprintScannerId(){try{const e=this.fingerprint.signals,n=this.fingerprint.fastBotDetectionDetails,a="FS1",m=[n.headlessChromeScreenResolution.detected,n.hasWebdriver.detected,n.hasWebdriverWritable.detected,n.hasSeleniumProperty.detected,n.hasCDP.detected,n.hasPlaywright.detected,n.hasImpossibleDeviceMemory.detected,n.hasHighCPUCount.detected,n.hasMissingChromeObject.detected,n.hasWebdriverIframe.detected,n.hasWebdriverWorker.detected,n.hasMismatchWebGLInWorker.detected,n.hasMismatchPlatformIframe.detected,n.hasMismatchPlatformWorker.detected,n.hasSwiftshaderRenderer.detected,n.hasUTCTimezone.detected].map(c=>c?"1":"0").join(""),u=[e.automation.webdriver===!0,e.automation.webdriverWritable===!0,e.automation.selenium===!0,e.automation.cdp===!0,e.automation.playwright===!0].map(c=>c?"1":"0").join(""),v=d(String(e.automation.navigatorPropertyDescriptors)).slice(0,4),o=`${u}h${v}`,f=typeof e.device.screenResolution.width=="number"?e.device.screenResolution.width:0,y=typeof e.device.screenResolution.height=="number"?e.device.screenResolution.height:0,E=typeof e.device.cpuCount=="number"?String(e.device.cpuCount).padStart(2,"0"):"00",A=typeof e.device.memory=="number"?String(Math.round(e.device.memory)).padStart(2,"0"):"00",P=[e.device.screenResolution.hasMultipleDisplays===!0,e.device.mediaQueries.prefersReducedMotion===!0,e.device.mediaQueries.prefersReducedTransparency===!0,e.device.mediaQueries.hover===!0,e.device.mediaQueries.anyHover===!0].map(c=>c?"1":"0").join(""),x=[e.device.platform,e.device.screenResolution.pixelDepth,e.device.screenResolution.colorDepth,e.device.multimediaDevices.speakers,e.device.multimediaDevices.microphones,e.device.multimediaDevices.webcams,e.device.mediaQueries.prefersColorScheme,e.device.mediaQueries.colorGamut,e.device.mediaQueries.pointer,e.device.mediaQueries.anyPointer,e.device.mediaQueries.colorDepth].map(c=>String(c)).join("|"),D=d(x).slice(0,6),M=`${f}x${y}c${E}m${A}b${P}h${D}`,_=typeof e.browser.features.bitmask=="string"?e.browser.features.bitmask:"0000000000",R=typeof e.browser.extensions.bitmask=="string"?e.browser.extensions.bitmask:"00000000",T=[e.browser.plugins.isValidPluginArray===!0,e.browser.plugins.pluginConsistency1===!0,e.browser.plugins.pluginOverflow===!0,e.browser.toSourceError.hasToSource===!0].map(c=>c?"1":"0").join(""),I=[e.browser.userAgent,e.browser.etsl,e.browser.maths,e.browser.plugins.pluginCount,e.browser.plugins.pluginNamesHash,e.browser.toSourceError.toSourceError,e.browser.highEntropyValues.architecture,e.browser.highEntropyValues.bitness,e.browser.highEntropyValues.platform,e.browser.highEntropyValues.platformVersion,e.browser.highEntropyValues.uaFullVersion,e.browser.highEntropyValues.mobile].map(c=>String(c)).join("|"),H=d(I).slice(0,6),O=`f${_}e${R}p${T}h${H}`,L=[e.graphics.canvas.hasModifiedCanvas===!0].map(c=>c?"1":"0").join(""),V=[e.graphics.webGL.vendor,e.graphics.webGL.renderer,e.graphics.webgpu.vendor,e.graphics.webgpu.architecture,e.graphics.webgpu.device,e.graphics.webgpu.description,e.graphics.canvas.canvasFingerprint].map(c=>String(c)).join("|"),j=d(V).slice(0,6),G=`${L}h${j}`,N=[e.codecs.hasMediaSource===!0].map(c=>c?"1":"0").join(""),B=[e.codecs.audioCanPlayTypeHash,e.codecs.videoCanPlayTypeHash,e.codecs.audioMediaSourceHash,e.codecs.videoMediaSourceHash,e.codecs.rtcAudioCapabilitiesHash,e.codecs.rtcVideoCapabilitiesHash].map(c=>String(c)).join("|"),F=d(B).slice(0,6),z=`${N}h${F}`,U=typeof e.locale.languages.language=="string"?e.locale.languages.language.slice(0,2).toLowerCase():"xx",$=Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.length:0,Q=(typeof e.locale.internationalization.timezone=="string"?e.locale.internationalization.timezone:"unknown").replace(/[\/\s]/g,"-"),K=[e.locale.internationalization.timezone,e.locale.internationalization.localeLanguage,Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.join(","):e.locale.languages.languages,e.locale.languages.language].map(c=>String(c)).join("|"),q=d(K).slice(0,4),J=`${U}${$}t${Q}_h${q}`,Y=[k(this.fingerprint,"iframe"),k(this.fingerprint,"worker"),e.contexts.iframe.webdriver===!0,e.contexts.webWorker.webdriver===!0].map(c=>c?"1":"0").join(""),Z=[e.contexts.iframe.userAgent,e.contexts.iframe.platform,e.contexts.iframe.memory,e.contexts.iframe.cpuCount,e.contexts.iframe.language,e.contexts.webWorker.userAgent,e.contexts.webWorker.platform,e.contexts.webWorker.memory,e.contexts.webWorker.cpuCount,e.contexts.webWorker.language,e.contexts.webWorker.vendor,e.contexts.webWorker.renderer].map(c=>String(c)).join("|"),X=d(Z).slice(0,6),ee=`${Y}h${X}`;return[a,m,o,M,O,G,z,J,ee].join("_")}catch(e){return console.error("Error generating fingerprint scanner id",e),l}}async encryptFingerprint(e){return await it(JSON.stringify(e),"dev-key")}getDetectionRules(){return[{name:"headlessChromeScreenResolution",severity:h,test:Be},{name:"hasWebdriver",severity:h,test:Fe},{name:"hasWebdriverWritable",severity:h,test:tt},{name:"hasSeleniumProperty",severity:h,test:ze},{name:"hasCDP",severity:h,test:Ue},{name:"hasPlaywright",severity:h,test:$e},{name:"hasImpossibleDeviceMemory",severity:h,test:Qe},{name:"hasHighCPUCount",severity:h,test:Ke},{name:"hasMissingChromeObject",severity:h,test:qe},{name:"hasWebdriverIframe",severity:h,test:Je},{name:"hasWebdriverWorker",severity:h,test:Ye},{name:"hasMismatchWebGLInWorker",severity:h,test:Ze},{name:"hasMismatchPlatformIframe",severity:h,test:et},{name:"hasMismatchPlatformWorker",severity:h,test:Xe},{name:"hasSwiftshaderRenderer",severity:ie,test:rt},{name:"hasUTCTimezone",severity:ae,test:nt}]}runDetectionRules(){const e=this.getDetectionRules(),n={headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}};for(const a of e)try{const i=a.test(this.fingerprint);n[a.name]={detected:i,severity:a.severity}}catch{n[a.name]={detected:!1,severity:a.severity}}return n}async collectFingerprint(e={encrypt:!0}){const{encrypt:n=!0,skipWorker:a=!1}=e,i=this.fingerprint.signals,m={webdriver:this.collectSignal(te),webdriverWritable:this.collectSignal(we),selenium:this.collectSignal(ye),cdp:this.collectSignal(se),playwright:this.collectSignal(le),navigatorPropertyDescriptors:this.collectSignal(He),cpuCount:this.collectSignal(ue),memory:this.collectSignal(ge),platform:this.collectSignal(ne),screenResolution:this.collectSignal(pe),multimediaDevices:this.collectSignal(Pe),mediaQueries:this.collectSignal(Ne),userAgent:this.collectSignal(re),browserFeatures:this.collectSignal(Ge),plugins:this.collectSignal(Ae),browserExtensions:this.collectSignal(je),highEntropyValues:this.collectSignal(be),etsl:this.collectSignal(he),maths:this.collectSignal(de),toSourceError:this.collectSignal(Me),webGL:this.collectSignal(ce),webgpu:this.collectSignal(ve),canvas:this.collectSignal(Ie),mediaCodecs:this.collectSignal(_e),internationalization:this.collectSignal(me),languages:this.collectSignal(fe),iframe:this.collectSignal(xe),webWorker:a?Promise.resolve({webdriver:p,userAgent:p,platform:p,memory:p,cpuCount:p,language:p,vendor:p,renderer:p}):this.collectSignal(De),nonce:this.collectSignal(Oe),time:this.collectSignal(Le),url:this.collectSignal(Ve)},u=Object.keys(m),v=await Promise.all(Object.values(m)),o=Object.fromEntries(u.map((f,y)=>[f,v[y]]));return i.automation.webdriver=o.webdriver,i.automation.webdriverWritable=o.webdriverWritable,i.automation.selenium=o.selenium,i.automation.cdp=o.cdp,i.automation.playwright=o.playwright,i.automation.navigatorPropertyDescriptors=o.navigatorPropertyDescriptors,i.device.cpuCount=o.cpuCount,i.device.memory=o.memory,i.device.platform=o.platform,i.device.screenResolution=o.screenResolution,i.device.multimediaDevices=o.multimediaDevices,i.device.mediaQueries=o.mediaQueries,i.browser.userAgent=o.userAgent,i.browser.features=o.browserFeatures,i.browser.plugins=o.plugins,i.browser.extensions=o.browserExtensions,i.browser.highEntropyValues=o.highEntropyValues,i.browser.etsl=o.etsl,i.browser.maths=o.maths,i.browser.toSourceError=o.toSourceError,i.graphics.webGL=o.webGL,i.graphics.webgpu=o.webgpu,i.graphics.canvas=o.canvas,i.codecs=o.mediaCodecs,i.locale.internationalization=o.internationalization,i.locale.languages=o.languages,i.contexts.iframe=o.iframe,i.contexts.webWorker=o.webWorker,this.fingerprint.nonce=o.nonce,this.fingerprint.time=o.time,this.fingerprint.url=o.url,this.fingerprint.fastBotDetectionDetails=this.runDetectionRules(),this.fingerprint.fastBotDetection=Object.values(this.fingerprint.fastBotDetectionDetails).some(f=>f.detected),this.fingerprint.fsid=this.generateFingerprintScannerId(),n?await this.encryptFingerprint(JSON.stringify(this.fingerprint)):this.fingerprint}}exports.default=at;
|
|
31
|
+
}`,a=new Blob([n],{type:"application/javascript"}),i=URL.createObjectURL(a),m=new Worker(i);m.onmessage=function(u){try{return e.vendor=u.data.vendor,e.renderer=u.data.renderer,e.userAgent=u.data.userAgent,e.language=u.data.language,e.platform=u.data.platform,e.memory=u.data.memory,e.cpuCount=u.data.cpuCount,t(e)}catch{return g(e,l),t(e)}}}catch{return g(e,l),t(e)}})}function Me(){const t={toSourceError:r,hasToSource:!1};try{null.usdfsh}catch(e){t.toSourceError=e.toString()}try{throw"xyz"}catch(e){try{e.toSource(),t.hasToSource=!0}catch{t.hasToSource=!1}}return t}const w=['audio/mp4; codecs="mp4a.40.2"',"audio/mpeg;",'audio/webm; codecs="vorbis"','audio/ogg; codecs="vorbis"','audio/wav; codecs="1"','audio/ogg; codecs="speex"','audio/ogg; codecs="flac"','audio/3gpp; codecs="samr"'],b=['video/mp4; codecs="avc1.42E01E, mp4a.40.2"','video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc1.58A01E"','video/mp4; codecs="avc1.4D401E"','video/mp4; codecs="avc1.64001E"','video/mp4; codecs="mp4v.20.8"','video/mp4; codecs="mp4v.20.240"','video/webm; codecs="vp8"','video/ogg; codecs="theora"','video/ogg; codecs="dirac"','video/3gpp; codecs="mp4v.20.8"','video/x-matroska; codecs="theora"'];function S(t,e){const n={};try{const a=document.createElement(e);for(const i of t)try{n[i]=a.canPlayType(i)||null}catch{n[i]=null}}catch{for(const a of t)n[a]=null}return n}function C(t){const e={},n=window.MediaSource;if(!n||typeof n.isTypeSupported!="function"){for(const a of t)e[a]=null;return e}for(const a of t)try{e[a]=n.isTypeSupported(a)}catch{e[a]=null}return e}function W(t){try{const e=window.RTCRtpReceiver;if(e&&typeof e.getCapabilities=="function"){const n=e.getCapabilities(t);return d(JSON.stringify(n))}return s}catch{return l}}function _e(){const t={audioCanPlayTypeHash:s,videoCanPlayTypeHash:s,audioMediaSourceHash:s,videoMediaSourceHash:s,rtcAudioCapabilitiesHash:s,rtcVideoCapabilitiesHash:s,hasMediaSource:!1};try{t.hasMediaSource=!!window.MediaSource;const e=S(w,"audio"),n=S(b,"video");t.audioCanPlayTypeHash=d(JSON.stringify(e)),t.videoCanPlayTypeHash=d(JSON.stringify(n));const a=C(w),i=C(b);t.audioMediaSourceHash=d(JSON.stringify(a)),t.videoMediaSourceHash=d(JSON.stringify(i)),t.rtcAudioCapabilitiesHash=W("audio"),t.rtcVideoCapabilitiesHash=W("video")}catch{g(t,l)}return t}async function Re(){return new Promise(t=>{try{const e=new Image,n=document.createElement("canvas").getContext("2d");e.onload=()=>{n.drawImage(e,0,0),t(n.getImageData(0,0,1,1).data.filter(a=>a===0).length!=4)},e.onerror=()=>{t(l)},e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}catch{t(l)}})}function Te(){var t=document.createElement("canvas");t.width=400,t.height=200,t.style.display="inline";var e=t.getContext("2d");try{return e.rect(0,0,10,10),e.rect(2,2,6,6),e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.font="11pt no-real-font-123",e.fillText("Cwm fjordbank glyphs vext quiz, đ",2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText("Cwm fjordbank glyphs vext quiz, đ",4,45),e.globalCompositeOperation="multiply",e.fillStyle="rgb(255,0,255)",e.beginPath(),e.arc(50,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(0,255,255)",e.beginPath(),e.arc(100,50,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,255,0)",e.beginPath(),e.arc(75,100,50,0,2*Math.PI,!0),e.closePath(),e.fill(),e.fillStyle="rgb(255,0,255)",e.arc(75,75,75,0,2*Math.PI,!0),e.arc(75,75,25,0,2*Math.PI,!0),e.fill("evenodd"),d(t.toDataURL())}catch{return l}}async function Ie(){const t={hasModifiedCanvas:r,canvasFingerprint:r};return t.hasModifiedCanvas=await Re(),t.canvasFingerprint=Te(),t}function He(){const t=["deviceMemory","hardwareConcurrency","language","languages","platform"],e=[];for(const n of t){const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator),n);a&&a.value?e.push("1"):e.push("0")}return e.join("")}function Oe(){return Math.random().toString(36).substring(2,15)}function Le(){return new Date().getTime()}function Ve(){return window.location.href}function k(t,e){const n=t.signals;return e==="iframe"?n.contexts.iframe.webdriver!==n.automation.webdriver||n.contexts.iframe.userAgent!==n.browser.userAgent||n.contexts.iframe.platform!==n.device.platform||n.contexts.iframe.memory!==n.device.memory||n.contexts.iframe.cpuCount!==n.device.cpuCount:n.contexts.webWorker.webdriver!==n.automation.webdriver||n.contexts.webWorker.userAgent!==n.browser.userAgent||n.contexts.webWorker.platform!==n.device.platform||n.contexts.webWorker.memory!==n.device.memory||n.contexts.webWorker.cpuCount!==n.device.cpuCount}function je(){const t={bitmask:r,extensions:[]},e=document.body.hasAttribute("data-gr-ext-installed"),n=typeof window.ethereum<"u",a=document.getElementById("coupon-birds-drop-div")!==null,i=document.querySelector("deepl-input-controller")!==null,m=document.getElementById("monica-content-root")!==null,u=document.querySelector("chatgpt-sidebar")!==null,v=typeof window.__REQUESTLY__<"u",o=Array.from(document.querySelectorAll("*")).filter(f=>f.tagName.toLowerCase().startsWith("veepn-")).length>0;return t.bitmask=[e?"1":"0",n?"1":"0",a?"1":"0",i?"1":"0",m?"1":"0",u?"1":"0",v?"1":"0",o?"1":"0"].join(""),e&&t.extensions.push("grammarly"),n&&t.extensions.push("metamask"),a&&t.extensions.push("coupon-birds"),i&&t.extensions.push("deepl"),m&&t.extensions.push("monica-ai"),u&&t.extensions.push("sider-ai"),v&&t.extensions.push("requestly"),o&&t.extensions.push("veepn"),t}function Ne(){const t={bitmask:r,chrome:"chrome"in window,brave:"brave"in navigator,applePaySupport:"ApplePaySetup"in window,opera:typeof window.opr<"u"||typeof window.onoperadetachedviewchange=="object",serial:window.navigator.serial!==void 0,attachShadow:!!Element.prototype.attachShadow,caches:!!window.caches,webAssembly:!!window.WebAssembly&&!!window.WebAssembly.instantiate,buffer:"Buffer"in window,showModalDialog:"showModalDialog"in window},e=Object.keys(t).filter(n=>n!=="bitmask").map(n=>t[n]?"1":"0").join("");return t.bitmask=e,t}function Ge(){const t={prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r};try{window.matchMedia("(prefers-color-scheme: dark)").matches?t.prefersColorScheme="dark":window.matchMedia("(prefers-color-scheme: light)").matches?t.prefersColorScheme="light":t.prefersColorScheme=null,t.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,t.prefersReducedTransparency=window.matchMedia("(prefers-reduced-transparency: reduce)").matches,window.matchMedia("(color-gamut: rec2020)").matches?t.colorGamut="rec2020":window.matchMedia("(color-gamut: p3)").matches?t.colorGamut="p3":window.matchMedia("(color-gamut: srgb)").matches?t.colorGamut="srgb":t.colorGamut=null,window.matchMedia("(pointer: fine)").matches?t.pointer="fine":window.matchMedia("(pointer: coarse)").matches?t.pointer="coarse":window.matchMedia("(pointer: none)").matches?t.pointer="none":t.pointer=null,window.matchMedia("(any-pointer: fine)").matches?t.anyPointer="fine":window.matchMedia("(any-pointer: coarse)").matches?t.anyPointer="coarse":window.matchMedia("(any-pointer: none)").matches?t.anyPointer="none":t.anyPointer=null,t.hover=window.matchMedia("(hover: hover)").matches,t.anyHover=window.matchMedia("(any-hover: hover)").matches;let e=0;for(let n=0;n<=16;n++)window.matchMedia(`(color: ${n})`).matches&&(e=n);t.colorDepth=e}catch{g(t,l)}return t}function Fe(t){const e=t.signals.device.screenResolution;return typeof e.width!="number"||typeof e.height!="number"?!1:e.width===600&&e.height===800||e.availableWidth===600&&e.availableHeight===800||e.innerWidth===600&&e.innerHeight===800}function Be(t){return t.signals.automation.webdriver===!0}function ze(t){return!!t.signals.automation.selenium}function Ue(t){return t.signals.automation.cdp===!0}function $e(t){return t.signals.automation.playwright===!0}function Qe(t){return typeof t.signals.device.memory!="number"?!1:t.signals.device.memory>8||t.signals.device.memory<.25}function Ke(t){return typeof t.signals.device.cpuCount!="number"?!1:t.signals.device.cpuCount>70}function qe(t){const e=t.signals.browser.userAgent;return t.signals.browser.features.chrome===!1&&typeof e=="string"&&e.includes("Chrome")}function Je(t){return t.signals.contexts.iframe.webdriver===!0}function Ye(t){return t.signals.contexts.webWorker.webdriver===!0}function Ze(t){const e=t.signals.contexts.webWorker,n=t.signals.graphics.webGL;return e.vendor===l||e.renderer===l||n.vendor===s||n.renderer===s||e.vendor===p?!1:e.vendor!==n.vendor||e.renderer!==n.renderer}function Xe(t){return t.signals.contexts.webWorker.platform===s||t.signals.contexts.webWorker.platform===l||t.signals.contexts.webWorker.platform===p?!1:t.signals.device.platform!==t.signals.contexts.webWorker.platform}function et(t){return t.signals.contexts.iframe.platform===s||t.signals.contexts.iframe.platform===l?!1:t.signals.device.platform!==t.signals.contexts.iframe.platform}function tt(t){return t.signals.automation.webdriverWritable===!0}function rt(t){return t.signals.graphics.webGL.renderer.includes("SwiftShader")}function nt(t){return t.signals.locale.internationalization.timezone==="UTC"}async function it(t,e){const n=new TextEncoder().encode(e),a=new TextEncoder().encode(t),i=new Uint8Array(a.length);for(let u=0;u<a.length;u++)i[u]=a[u]^n[u%n.length];const m=String.fromCharCode(...i);return btoa(m)}class at{constructor(){this.fingerprint={signals:{automation:{webdriver:r,webdriverWritable:r,selenium:r,cdp:r,playwright:r,navigatorPropertyDescriptors:r},device:{cpuCount:r,memory:r,platform:r,screenResolution:{width:r,height:r,pixelDepth:r,colorDepth:r,availableWidth:r,availableHeight:r,innerWidth:r,innerHeight:r,hasMultipleDisplays:r},multimediaDevices:{speakers:r,microphones:r,webcams:r},mediaQueries:{prefersColorScheme:r,prefersReducedMotion:r,prefersReducedTransparency:r,colorGamut:r,pointer:r,anyPointer:r,hover:r,anyHover:r,colorDepth:r}},browser:{userAgent:r,features:{bitmask:r,chrome:r,brave:r,applePaySupport:r,opera:r,serial:r,attachShadow:r,caches:r,webAssembly:r,buffer:r,showModalDialog:r},plugins:{isValidPluginArray:r,pluginCount:r,pluginNamesHash:r,pluginConsistency1:r,pluginOverflow:r},extensions:{bitmask:r,extensions:r},highEntropyValues:{architecture:r,bitness:r,brands:r,mobile:r,model:r,platform:r,platformVersion:r,uaFullVersion:r},etsl:r,maths:r,toSourceError:{toSourceError:r,hasToSource:r}},graphics:{webGL:{vendor:r,renderer:r},webgpu:{vendor:r,architecture:r,device:r,description:r},canvas:{hasModifiedCanvas:r,canvasFingerprint:r}},codecs:{audioCanPlayTypeHash:r,videoCanPlayTypeHash:r,audioMediaSourceHash:r,videoMediaSourceHash:r,rtcAudioCapabilitiesHash:r,rtcVideoCapabilitiesHash:r,hasMediaSource:r},locale:{internationalization:{timezone:r,localeLanguage:r},languages:{languages:r,language:r}},contexts:{iframe:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r},webWorker:{webdriver:r,userAgent:r,platform:r,memory:r,cpuCount:r,language:r,vendor:r,renderer:r}}},fsid:r,nonce:r,time:r,url:r,fastBotDetection:!1,fastBotDetectionDetails:{headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}}}}async collectSignal(e){try{return await e()}catch{return l}}generateFingerprintScannerId(){try{const e=this.fingerprint.signals,n=this.fingerprint.fastBotDetectionDetails,a="FS1",m=[n.headlessChromeScreenResolution.detected,n.hasWebdriver.detected,n.hasWebdriverWritable.detected,n.hasSeleniumProperty.detected,n.hasCDP.detected,n.hasPlaywright.detected,n.hasImpossibleDeviceMemory.detected,n.hasHighCPUCount.detected,n.hasMissingChromeObject.detected,n.hasWebdriverIframe.detected,n.hasWebdriverWorker.detected,n.hasMismatchWebGLInWorker.detected,n.hasMismatchPlatformIframe.detected,n.hasMismatchPlatformWorker.detected,n.hasSwiftshaderRenderer.detected,n.hasUTCTimezone.detected].map(c=>c?"1":"0").join(""),u=[e.automation.webdriver===!0,e.automation.webdriverWritable===!0,e.automation.selenium===!0,e.automation.cdp===!0,e.automation.playwright===!0].map(c=>c?"1":"0").join(""),v=d(String(e.automation.navigatorPropertyDescriptors)).slice(0,4),o=`${u}h${v}`,f=typeof e.device.screenResolution.width=="number"?e.device.screenResolution.width:0,y=typeof e.device.screenResolution.height=="number"?e.device.screenResolution.height:0,E=typeof e.device.cpuCount=="number"?String(e.device.cpuCount).padStart(2,"0"):"00",A=typeof e.device.memory=="number"?String(Math.round(e.device.memory)).padStart(2,"0"):"00",x=[e.device.screenResolution.hasMultipleDisplays===!0,e.device.mediaQueries.prefersReducedMotion===!0,e.device.mediaQueries.prefersReducedTransparency===!0,e.device.mediaQueries.hover===!0,e.device.mediaQueries.anyHover===!0].map(c=>c?"1":"0").join(""),P=[e.device.platform,e.device.screenResolution.pixelDepth,e.device.screenResolution.colorDepth,e.device.multimediaDevices.speakers,e.device.multimediaDevices.microphones,e.device.multimediaDevices.webcams,e.device.mediaQueries.prefersColorScheme,e.device.mediaQueries.colorGamut,e.device.mediaQueries.pointer,e.device.mediaQueries.anyPointer,e.device.mediaQueries.colorDepth].map(c=>String(c)).join("|"),D=d(P).slice(0,6),M=`${f}x${y}c${E}m${A}b${x}h${D}`,_=typeof e.browser.features.bitmask=="string"?e.browser.features.bitmask:"0000000000",R=typeof e.browser.extensions.bitmask=="string"?e.browser.extensions.bitmask:"00000000",T=[e.browser.plugins.isValidPluginArray===!0,e.browser.plugins.pluginConsistency1===!0,e.browser.plugins.pluginOverflow===!0,e.browser.toSourceError.hasToSource===!0].map(c=>c?"1":"0").join(""),I=[e.browser.userAgent,e.browser.etsl,e.browser.maths,e.browser.plugins.pluginCount,e.browser.plugins.pluginNamesHash,e.browser.toSourceError.toSourceError,e.browser.highEntropyValues.architecture,e.browser.highEntropyValues.bitness,e.browser.highEntropyValues.platform,e.browser.highEntropyValues.platformVersion,e.browser.highEntropyValues.uaFullVersion,e.browser.highEntropyValues.mobile].map(c=>String(c)).join("|"),H=d(I).slice(0,6),O=`f${_}e${R}p${T}h${H}`,L=[e.graphics.canvas.hasModifiedCanvas===!0].map(c=>c?"1":"0").join(""),V=[e.graphics.webGL.vendor,e.graphics.webGL.renderer,e.graphics.webgpu.vendor,e.graphics.webgpu.architecture,e.graphics.webgpu.device,e.graphics.webgpu.description,e.graphics.canvas.canvasFingerprint].map(c=>String(c)).join("|"),j=d(V).slice(0,6),N=`${L}h${j}`,G=[e.codecs.hasMediaSource===!0].map(c=>c?"1":"0").join(""),F=[e.codecs.audioCanPlayTypeHash,e.codecs.videoCanPlayTypeHash,e.codecs.audioMediaSourceHash,e.codecs.videoMediaSourceHash,e.codecs.rtcAudioCapabilitiesHash,e.codecs.rtcVideoCapabilitiesHash].map(c=>String(c)).join("|"),B=d(F).slice(0,6),z=`${G}h${B}`,U=typeof e.locale.languages.language=="string"?e.locale.languages.language.slice(0,2).toLowerCase():"xx",$=Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.length:0,Q=(typeof e.locale.internationalization.timezone=="string"?e.locale.internationalization.timezone:"unknown").replace(/[\/\s]/g,"-"),K=[e.locale.internationalization.timezone,e.locale.internationalization.localeLanguage,Array.isArray(e.locale.languages.languages)?e.locale.languages.languages.join(","):e.locale.languages.languages,e.locale.languages.language].map(c=>String(c)).join("|"),q=d(K).slice(0,4),J=`${U}${$}t${Q}_h${q}`,Y=[k(this.fingerprint,"iframe"),k(this.fingerprint,"worker"),e.contexts.iframe.webdriver===!0,e.contexts.webWorker.webdriver===!0].map(c=>c?"1":"0").join(""),Z=[e.contexts.iframe.userAgent,e.contexts.iframe.platform,e.contexts.iframe.memory,e.contexts.iframe.cpuCount,e.contexts.iframe.language,e.contexts.webWorker.userAgent,e.contexts.webWorker.platform,e.contexts.webWorker.memory,e.contexts.webWorker.cpuCount,e.contexts.webWorker.language,e.contexts.webWorker.vendor,e.contexts.webWorker.renderer].map(c=>String(c)).join("|"),X=d(Z).slice(0,6),ee=`${Y}h${X}`;return[a,m,o,M,O,N,z,J,ee].join("_")}catch(e){return console.error("Error generating fingerprint scanner id",e),l}}async encryptFingerprint(e){const n="__DEFAULT_FPSCANNER_KEY__";return n.length>20&&n.indexOf("DEFAULT")>0&&n.indexOf("FPSCANNER")>0&&console.warn('[fpscanner] WARNING: Using default encryption key! Run "npx fpscanner build --key=your-secret-key" to inject your own key. See: https://github.com/antoinevastel/fpscanner#advanced-custom-builds'),await it(JSON.stringify(e),n)}getDetectionRules(){return[{name:"headlessChromeScreenResolution",severity:h,test:Fe},{name:"hasWebdriver",severity:h,test:Be},{name:"hasWebdriverWritable",severity:h,test:tt},{name:"hasSeleniumProperty",severity:h,test:ze},{name:"hasCDP",severity:h,test:Ue},{name:"hasPlaywright",severity:h,test:$e},{name:"hasImpossibleDeviceMemory",severity:h,test:Qe},{name:"hasHighCPUCount",severity:h,test:Ke},{name:"hasMissingChromeObject",severity:h,test:qe},{name:"hasWebdriverIframe",severity:h,test:Je},{name:"hasWebdriverWorker",severity:h,test:Ye},{name:"hasMismatchWebGLInWorker",severity:h,test:Ze},{name:"hasMismatchPlatformIframe",severity:h,test:et},{name:"hasMismatchPlatformWorker",severity:h,test:Xe},{name:"hasSwiftshaderRenderer",severity:ie,test:rt},{name:"hasUTCTimezone",severity:ae,test:nt}]}runDetectionRules(){const e=this.getDetectionRules(),n={headlessChromeScreenResolution:{detected:!1,severity:"high"},hasWebdriver:{detected:!1,severity:"high"},hasWebdriverWritable:{detected:!1,severity:"high"},hasSeleniumProperty:{detected:!1,severity:"high"},hasCDP:{detected:!1,severity:"high"},hasPlaywright:{detected:!1,severity:"high"},hasImpossibleDeviceMemory:{detected:!1,severity:"high"},hasHighCPUCount:{detected:!1,severity:"high"},hasMissingChromeObject:{detected:!1,severity:"high"},hasWebdriverIframe:{detected:!1,severity:"high"},hasWebdriverWorker:{detected:!1,severity:"high"},hasMismatchWebGLInWorker:{detected:!1,severity:"high"},hasMismatchPlatformIframe:{detected:!1,severity:"high"},hasMismatchPlatformWorker:{detected:!1,severity:"high"},hasSwiftshaderRenderer:{detected:!1,severity:"low"},hasUTCTimezone:{detected:!1,severity:"medium"}};for(const a of e)try{const i=a.test(this.fingerprint);n[a.name]={detected:i,severity:a.severity}}catch{n[a.name]={detected:!1,severity:a.severity}}return n}async collectFingerprint(e={encrypt:!0}){const{encrypt:n=!0,skipWorker:a=!1}=e,i=this.fingerprint.signals,m={webdriver:this.collectSignal(te),webdriverWritable:this.collectSignal(we),selenium:this.collectSignal(ye),cdp:this.collectSignal(se),playwright:this.collectSignal(le),navigatorPropertyDescriptors:this.collectSignal(He),cpuCount:this.collectSignal(ue),memory:this.collectSignal(ge),platform:this.collectSignal(ne),screenResolution:this.collectSignal(pe),multimediaDevices:this.collectSignal(xe),mediaQueries:this.collectSignal(Ge),userAgent:this.collectSignal(re),browserFeatures:this.collectSignal(Ne),plugins:this.collectSignal(Ae),browserExtensions:this.collectSignal(je),highEntropyValues:this.collectSignal(be),etsl:this.collectSignal(he),maths:this.collectSignal(de),toSourceError:this.collectSignal(Me),webGL:this.collectSignal(ce),webgpu:this.collectSignal(ve),canvas:this.collectSignal(Ie),mediaCodecs:this.collectSignal(_e),internationalization:this.collectSignal(me),languages:this.collectSignal(fe),iframe:this.collectSignal(Pe),webWorker:a?Promise.resolve({webdriver:p,userAgent:p,platform:p,memory:p,cpuCount:p,language:p,vendor:p,renderer:p}):this.collectSignal(De),nonce:this.collectSignal(Oe),time:this.collectSignal(Le),url:this.collectSignal(Ve)},u=Object.keys(m),v=await Promise.all(Object.values(m)),o=Object.fromEntries(u.map((f,y)=>[f,v[y]]));return i.automation.webdriver=o.webdriver,i.automation.webdriverWritable=o.webdriverWritable,i.automation.selenium=o.selenium,i.automation.cdp=o.cdp,i.automation.playwright=o.playwright,i.automation.navigatorPropertyDescriptors=o.navigatorPropertyDescriptors,i.device.cpuCount=o.cpuCount,i.device.memory=o.memory,i.device.platform=o.platform,i.device.screenResolution=o.screenResolution,i.device.multimediaDevices=o.multimediaDevices,i.device.mediaQueries=o.mediaQueries,i.browser.userAgent=o.userAgent,i.browser.features=o.browserFeatures,i.browser.plugins=o.plugins,i.browser.extensions=o.browserExtensions,i.browser.highEntropyValues=o.highEntropyValues,i.browser.etsl=o.etsl,i.browser.maths=o.maths,i.browser.toSourceError=o.toSourceError,i.graphics.webGL=o.webGL,i.graphics.webgpu=o.webgpu,i.graphics.canvas=o.canvas,i.codecs=o.mediaCodecs,i.locale.internationalization=o.internationalization,i.locale.languages=o.languages,i.contexts.iframe=o.iframe,i.contexts.webWorker=o.webWorker,this.fingerprint.nonce=o.nonce,this.fingerprint.time=o.time,this.fingerprint.url=o.url,this.fingerprint.fastBotDetectionDetails=this.runDetectionRules(),this.fingerprint.fastBotDetection=Object.values(this.fingerprint.fastBotDetectionDetails).some(f=>f.detected),this.fingerprint.fsid=this.generateFingerprintScannerId(),n?await this.encryptFingerprint(JSON.stringify(this.fingerprint)):this.fingerprint}}exports.default=at;
|
package/dist/fpScanner.es.js
CHANGED
|
@@ -532,7 +532,7 @@ function je() {
|
|
|
532
532
|
o ? "1" : "0"
|
|
533
533
|
].join(""), e && t.extensions.push("grammarly"), n && t.extensions.push("metamask"), a && t.extensions.push("coupon-birds"), i && t.extensions.push("deepl"), m && t.extensions.push("monica-ai"), u && t.extensions.push("sider-ai"), v && t.extensions.push("requestly"), o && t.extensions.push("veepn"), t;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function Ne() {
|
|
536
536
|
const t = {
|
|
537
537
|
bitmask: r,
|
|
538
538
|
chrome: "chrome" in window,
|
|
@@ -548,7 +548,7 @@ function Ge() {
|
|
|
548
548
|
}, e = Object.keys(t).filter((n) => n !== "bitmask").map((n) => t[n] ? "1" : "0").join("");
|
|
549
549
|
return t.bitmask = e, t;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Ge() {
|
|
552
552
|
const t = {
|
|
553
553
|
prefersColorScheme: r,
|
|
554
554
|
prefersReducedMotion: r,
|
|
@@ -571,11 +571,11 @@ function Ne() {
|
|
|
571
571
|
}
|
|
572
572
|
return t;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Fe(t) {
|
|
575
575
|
const e = t.signals.device.screenResolution;
|
|
576
576
|
return typeof e.width != "number" || typeof e.height != "number" ? !1 : e.width === 600 && e.height === 800 || e.availableWidth === 600 && e.availableHeight === 800 || e.innerWidth === 600 && e.innerHeight === 800;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Be(t) {
|
|
579
579
|
return t.signals.automation.webdriver === !0;
|
|
580
580
|
}
|
|
581
581
|
function ze(t) {
|
|
@@ -904,16 +904,16 @@ class ot {
|
|
|
904
904
|
e.graphics.webgpu.device,
|
|
905
905
|
e.graphics.webgpu.description,
|
|
906
906
|
e.graphics.canvas.canvasFingerprint
|
|
907
|
-
].map((c) => String(c)).join("|"), j = d(V).slice(0, 6),
|
|
907
|
+
].map((c) => String(c)).join("|"), j = d(V).slice(0, 6), N = `${L}h${j}`, G = [
|
|
908
908
|
e.codecs.hasMediaSource === !0
|
|
909
|
-
].map((c) => c ? "1" : "0").join(""),
|
|
909
|
+
].map((c) => c ? "1" : "0").join(""), F = [
|
|
910
910
|
e.codecs.audioCanPlayTypeHash,
|
|
911
911
|
e.codecs.videoCanPlayTypeHash,
|
|
912
912
|
e.codecs.audioMediaSourceHash,
|
|
913
913
|
e.codecs.videoMediaSourceHash,
|
|
914
914
|
e.codecs.rtcAudioCapabilitiesHash,
|
|
915
915
|
e.codecs.rtcVideoCapabilitiesHash
|
|
916
|
-
].map((c) => String(c)).join("|"),
|
|
916
|
+
].map((c) => String(c)).join("|"), B = d(F).slice(0, 6), z = `${G}h${B}`, U = typeof e.locale.languages.language == "string" ? e.locale.languages.language.slice(0, 2).toLowerCase() : "xx", $ = Array.isArray(e.locale.languages.languages) ? e.locale.languages.languages.length : 0, Q = (typeof e.locale.internationalization.timezone == "string" ? e.locale.internationalization.timezone : "unknown").replace(/[\/\s]/g, "-"), K = [
|
|
917
917
|
e.locale.internationalization.timezone,
|
|
918
918
|
e.locale.internationalization.localeLanguage,
|
|
919
919
|
Array.isArray(e.locale.languages.languages) ? e.locale.languages.languages.join(",") : e.locale.languages.languages,
|
|
@@ -943,7 +943,7 @@ class ot {
|
|
|
943
943
|
o,
|
|
944
944
|
M,
|
|
945
945
|
O,
|
|
946
|
-
|
|
946
|
+
N,
|
|
947
947
|
z,
|
|
948
948
|
J,
|
|
949
949
|
ee
|
|
@@ -953,7 +953,10 @@ class ot {
|
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
async encryptFingerprint(e) {
|
|
956
|
-
|
|
956
|
+
const n = "__DEFAULT_FPSCANNER_KEY__";
|
|
957
|
+
return n.length > 20 && n.indexOf("DEFAULT") > 0 && n.indexOf("FPSCANNER") > 0 && console.warn(
|
|
958
|
+
'[fpscanner] WARNING: Using default encryption key! Run "npx fpscanner build --key=your-secret-key" to inject your own key. See: https://github.com/antoinevastel/fpscanner#advanced-custom-builds'
|
|
959
|
+
), await it(JSON.stringify(e), n);
|
|
957
960
|
}
|
|
958
961
|
/**
|
|
959
962
|
* Detection rules with name and severity.
|
|
@@ -961,8 +964,8 @@ class ot {
|
|
|
961
964
|
*/
|
|
962
965
|
getDetectionRules() {
|
|
963
966
|
return [
|
|
964
|
-
{ name: "headlessChromeScreenResolution", severity: g, test:
|
|
965
|
-
{ name: "hasWebdriver", severity: g, test:
|
|
967
|
+
{ name: "headlessChromeScreenResolution", severity: g, test: Fe },
|
|
968
|
+
{ name: "hasWebdriver", severity: g, test: Be },
|
|
966
969
|
{ name: "hasWebdriverWritable", severity: g, test: tt },
|
|
967
970
|
{ name: "hasSeleniumProperty", severity: g, test: ze },
|
|
968
971
|
{ name: "hasCDP", severity: g, test: Ue },
|
|
@@ -1022,10 +1025,10 @@ class ot {
|
|
|
1022
1025
|
platform: this.collectSignal(ne),
|
|
1023
1026
|
screenResolution: this.collectSignal(pe),
|
|
1024
1027
|
multimediaDevices: this.collectSignal(xe),
|
|
1025
|
-
mediaQueries: this.collectSignal(
|
|
1028
|
+
mediaQueries: this.collectSignal(Ge),
|
|
1026
1029
|
// Browser signals
|
|
1027
1030
|
userAgent: this.collectSignal(re),
|
|
1028
|
-
browserFeatures: this.collectSignal(
|
|
1031
|
+
browserFeatures: this.collectSignal(Ne),
|
|
1029
1032
|
plugins: this.collectSignal(Ae),
|
|
1030
1033
|
browserExtensions: this.collectSignal(je),
|
|
1031
1034
|
highEntropyValues: this.collectSignal(be),
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAE,WAAW,EAA0C,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGzG,cAAM,kBAAkB;IACpB,OAAO,CAAC,WAAW,CAAc;;YAiLnB,aAAa;IAQ3B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,4BAA4B;YA2LtB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAE,WAAW,EAA0C,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGzG,cAAM,kBAAkB;IACpB,OAAO,CAAC,WAAW,CAAc;;YAiLnB,aAAa;IAQ3B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,4BAA4B;YA2LtB,kBAAkB;IAoBhC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,iBAAiB;IAiCnB,kBAAkB,CAAC,OAAO,GAAE,yBAA6C;CA0HlF;AAED,eAAe,kBAAkB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fpscanner",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "A lightweight browser fingerprinting and bot detection library with encryption, obfuscation, and cross-context validation",
|
|
5
5
|
"main": "dist/fpScanner.cjs.js",
|
|
6
6
|
"module": "dist/fpScanner.es.js",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"test": "npm run test:playwright",
|
|
29
29
|
"test:vitest": "vitest",
|
|
30
30
|
"test:playwright": "npm run build:obfuscate && npx playwright test",
|
|
31
|
-
"test:playwright:headed": "npm run build:obfuscate && npx playwright test --headed"
|
|
31
|
+
"test:playwright:headed": "npm run build:obfuscate && npx playwright test --headed",
|
|
32
|
+
"prepublishOnly": "node scripts/verify-publish.js"
|
|
32
33
|
},
|
|
33
34
|
"repository": {
|
|
34
35
|
"type": "git",
|
package/scripts/build-custom.js
CHANGED
|
@@ -39,13 +39,15 @@ module.exports = async function build(args) {
|
|
|
39
39
|
console.log(` Obfuscation: ${skipObfuscation ? 'disabled' : 'enabled'}`);
|
|
40
40
|
console.log('');
|
|
41
41
|
|
|
42
|
-
// Check if
|
|
43
|
-
const
|
|
44
|
-
|
|
42
|
+
// Check if we can build from source (more reliable than string replacement)
|
|
43
|
+
const viteConfigPath = path.join(packageDir, 'vite.config.ts');
|
|
44
|
+
const canBuildFromSource = fs.existsSync(viteConfigPath);
|
|
45
45
|
|
|
46
|
-
if (
|
|
47
|
-
//
|
|
48
|
-
|
|
46
|
+
if (canBuildFromSource) {
|
|
47
|
+
// Preferred method: Build from source with key injected via environment variable
|
|
48
|
+
// This is more reliable as Vite's define properly replaces the key during the build
|
|
49
|
+
console.log('đĻ Step 0/5: Building from source with injected key...');
|
|
50
|
+
console.log(' (This is more reliable than post-build string replacement)');
|
|
49
51
|
try {
|
|
50
52
|
execSync('npm run build:vite', {
|
|
51
53
|
cwd: packageDir,
|
|
@@ -61,43 +63,59 @@ module.exports = async function build(args) {
|
|
|
61
63
|
cwd: packageDir,
|
|
62
64
|
stdio: 'inherit',
|
|
63
65
|
});
|
|
66
|
+
console.log('');
|
|
67
|
+
console.log('đĻ Step 1/5: Key injected during build â');
|
|
64
68
|
} catch (err) {
|
|
65
|
-
throw new Error('Build from source failed');
|
|
69
|
+
throw new Error('Build from source failed. Make sure vite is installed (npm install)');
|
|
66
70
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
let keyInjected = false;
|
|
74
|
-
for (const file of files) {
|
|
75
|
-
const filePath = path.join(distDir, file);
|
|
71
|
+
} else {
|
|
72
|
+
// Fallback method: String replacement in pre-built dist files
|
|
73
|
+
// Used when vite.config.ts is not available (npm consumers without dev dependencies)
|
|
74
|
+
console.log('đĻ Step 1/5: Injecting encryption key via string replacement...');
|
|
75
|
+
console.log(' (Fallback method - vite.config.ts not found)');
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
let keyInjected = false;
|
|
78
|
+
for (const file of files) {
|
|
79
|
+
const filePath = path.join(distDir, file);
|
|
80
|
+
|
|
81
|
+
if (!fs.existsSync(filePath)) {
|
|
82
|
+
console.log(` â ī¸ ${file} not found, skipping`);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
87
|
+
|
|
88
|
+
// Check if sentinel exists
|
|
89
|
+
if (!code.includes(sentinel)) {
|
|
90
|
+
console.log(` â ī¸ ${file} does not contain the default key sentinel`);
|
|
91
|
+
console.log(` Key may have already been replaced, or dist needs to be rebuilt`);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Replace all occurrences of the sentinel with the actual key
|
|
96
|
+
const escapedSentinel = sentinel.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
97
|
+
const newCode = code.replace(new RegExp(`"${escapedSentinel}"`, 'g'), JSON.stringify(key));
|
|
98
|
+
|
|
99
|
+
// Verify the replacement worked
|
|
100
|
+
if (newCode === code) {
|
|
101
|
+
console.log(` â ī¸ ${file} - replacement had no effect`);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (newCode.includes(sentinel)) {
|
|
106
|
+
console.log(` â ī¸ ${file} - sentinel still present after replacement`);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
fs.writeFileSync(filePath, newCode);
|
|
111
|
+
keyInjected = true;
|
|
112
|
+
console.log(` â ${file}`);
|
|
80
113
|
}
|
|
81
114
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (!code.includes(sentinel)) {
|
|
86
|
-
console.log(` â ī¸ ${file} does not contain the default key sentinel, skipping`);
|
|
87
|
-
continue;
|
|
115
|
+
if (!keyInjected) {
|
|
116
|
+
console.log(' â ī¸ Warning: No files were updated');
|
|
117
|
+
console.log(' The key may have already been injected, or dist files may need rebuilding');
|
|
88
118
|
}
|
|
89
|
-
|
|
90
|
-
// Replace all occurrences of the sentinel with the actual key
|
|
91
|
-
const escapedSentinel = sentinel.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
92
|
-
code = code.replace(new RegExp(`"${escapedSentinel}"`, 'g'), JSON.stringify(key));
|
|
93
|
-
|
|
94
|
-
fs.writeFileSync(filePath, code);
|
|
95
|
-
keyInjected = true;
|
|
96
|
-
console.log(` â ${file}`);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (!keyInjected) {
|
|
100
|
-
console.log(' âšī¸ Key already injected during build step');
|
|
101
119
|
}
|
|
102
120
|
|
|
103
121
|
// Step 2: Skip TypeScript declarations (already generated)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pre-publish verification script
|
|
5
|
+
* Ensures the dist files contain the sentinel key for npm consumers
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
|
|
11
|
+
const distDir = path.join(__dirname, '..', 'dist');
|
|
12
|
+
const files = ['fpScanner.es.js', 'fpScanner.cjs.js'];
|
|
13
|
+
const sentinel = '__DEFAULT_FPSCANNER_KEY__';
|
|
14
|
+
|
|
15
|
+
console.log('đ Verifying dist files before publish...\n');
|
|
16
|
+
|
|
17
|
+
let allPassed = true;
|
|
18
|
+
|
|
19
|
+
for (const file of files) {
|
|
20
|
+
const filePath = path.join(distDir, file);
|
|
21
|
+
|
|
22
|
+
if (!fs.existsSync(filePath)) {
|
|
23
|
+
console.log(`â ${file}: File not found`);
|
|
24
|
+
allPassed = false;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
29
|
+
const matches = content.match(new RegExp(`"${sentinel}"`, 'g'));
|
|
30
|
+
|
|
31
|
+
if (!matches || matches.length === 0) {
|
|
32
|
+
console.log(`â ${file}: Sentinel key "${sentinel}" NOT found`);
|
|
33
|
+
console.log(` This file cannot be published - consumers won't be able to inject their keys!`);
|
|
34
|
+
allPassed = false;
|
|
35
|
+
} else {
|
|
36
|
+
console.log(`â
${file}: Sentinel key found (${matches.length} occurrence${matches.length > 1 ? 's' : ''})`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log('');
|
|
41
|
+
|
|
42
|
+
if (allPassed) {
|
|
43
|
+
console.log('â
All checks passed! Safe to publish.');
|
|
44
|
+
process.exit(0);
|
|
45
|
+
} else {
|
|
46
|
+
console.log('â Verification failed!');
|
|
47
|
+
console.log('');
|
|
48
|
+
console.log('To fix:');
|
|
49
|
+
console.log(' 1. Make sure FP_ENCRYPTION_KEY is NOT set in your environment');
|
|
50
|
+
console.log(' 2. Run: rm -rf dist && npm run build');
|
|
51
|
+
console.log(' 3. Run this script again to verify');
|
|
52
|
+
console.log('');
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -453,6 +453,17 @@ class FingerprintScanner {
|
|
|
453
453
|
// Key is injected at build time via Vite's define option
|
|
454
454
|
// Customers run: npx fpscanner build --key=their-key
|
|
455
455
|
const key = __FP_ENCRYPTION_KEY__;
|
|
456
|
+
|
|
457
|
+
// Runtime safety check: warn if using the default sentinel key
|
|
458
|
+
// Use a dynamic check that prevents build-time optimization
|
|
459
|
+
if (key.length > 20 && key.indexOf('DEFAULT') > 0 && key.indexOf('FPSCANNER') > 0) {
|
|
460
|
+
console.warn(
|
|
461
|
+
'[fpscanner] WARNING: Using default encryption key! ' +
|
|
462
|
+
'Run "npx fpscanner build --key=your-secret-key" to inject your own key. ' +
|
|
463
|
+
'See: https://github.com/antoinevastel/fpscanner#advanced-custom-builds'
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
456
467
|
const enc = await encryptString(JSON.stringify(fingerprint), key);
|
|
457
468
|
|
|
458
469
|
return enc;
|