fingerprint-suite icon indicating copy to clipboard operation
fingerprint-suite copied to clipboard

fixIframeContentWindow method writes to log "TypeError: Cannot redefine property: createElement"

Open dekelev opened this issue 2 years ago • 2 comments

fixIframeContentWindow method writes to log "TypeError: Cannot redefine property: createElement".

To Reproduce Run non-headless and load https://www.example.com.

Expected behavior No warnings in console log.

System information:

  • OS: MacOS
  • Node.js v16.14.0
  • Puppeteer v15.1.0
  • fingerprint-injector v2.0.6
image

dekelev avatar Aug 24 '22 12:08 dekelev

fixPluginArray works bad too.. like (length is "undefined")

ja3abuser avatar Sep 02 '22 20:09 ja3abuser

For me the issue happens in non-headless mode, so I'm not sure how it works in the headless mode.

I haven't seen an issue with fixPluginArray, but since both fixIframeContentWindow & fixPluginArray methods are called from the runHeadlessFixes method, I wonder if the issue in the first place is that the runHeadlessFixes method is being called in non-headless mode too.

In the fixIframeContentWindow method, the issue is basically this line _iframe.srcdoc = newValue where srcdoc, which is set with writable: false (read only), fails to receive a new value.

Maybe we can pass a headless boolean flag to the attachFingerprintToPuppeteer method, so that the runHeadlessFixes method will only run when headless is true.

dekelev avatar Sep 03 '22 07:09 dekelev

Sorry for taking so long, this issue must have slipped my attention! Unfortunately, I didn't manage to replicate this issue, but I just got rid of the warning message at the very least. The headless fixes were made to be "idempotent" - in a way that they don't do anything if run in headful mode.

I'll close this issue, but will keep an eye on this - and as always - feel free to reopen it if unsure abt sth :)

barjin avatar Nov 05 '22 19:11 barjin