berstend / puppeteer-extra

💯 Teach puppeteer new tricks through plugins.
https://extra.community
MIT License
6.23k stars 732 forks source link

[Bug] Fingerprinting issue with "puppeteer-extra-stealth-plugin" package #816

Open m0riya42 opened 1 year ago

m0riya42 commented 1 year ago

Describe the bug I have encountered a case of browser fingerprinting while using the "puppeteer-extra-stealth-plugin" package. The website that was able to detect my scraper seems to have utilized the fact that there is an override of the 'includes' method within the Array object in the package (or one of its dependency packages).

Example of Fingerprinting Function:

function isIncludesOverridden() {
    var keepIncludeFunction = Array['prototype']['includes'];

    Array['prototype']['includes'] = function () {
        console.log(`'includes' method within the Array object is overridden`);
    },

    document['createElement']('video')['canPlayType']('video/mp4')
    Array['prototype']['includes'] = keepIncludeFunction;
}

isIncludesOverridden()

It appears that this fingerprinting technique was used to identify and block the scraper.

Versions

"puppeteer-extra-plugin-stealth": "^2.11.2",

julian-george commented 11 months ago

Is there a way to manually "un-override" the includes method until this is resolved? Wondering if recent implementation of this fingerprinting is what has caused the failure of my scraper since some point in June.