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

Inject `MediaSource` API to hide codec support

Open JaneJeon opened this issue 3 years ago • 4 comments

Just a quick one, but according to https://github.com/berstend/puppeteer-extra/wiki/Using-Google-Chrome-instead-of-Chromium, Chromium gets detected because of the media codec types it supports.

Looks like this repo is already doing a form of codec injection, but since we're injecting the codec already thought it might be good to "patch up" another place where the codec could be exposed (via the MediaSource API).

Thanks

JaneJeon avatar Mar 11 '22 21:03 JaneJeon

I think this makes sense, otherwise, this "lie" could be easily detected.

petrpatek avatar Mar 13 '22 15:03 petrpatek

What's the reason of not using Google Chrome instead?

szmarczak avatar Jul 06 '22 17:07 szmarczak

Thanks for bringing this up! As @szmarczak mentioned, there is an easy quick fix - using Playwright's channel: 'chrome' option (see lower). This way, your automation framework controls an actual instance of a Chrome browser. Unfortunately, I am afraid we do not collect enough data to perform reliable codec support injection as of now.

(async () => {
    const b = await chromium.launch({
        'channel':'chrome', // try commenting this line to see the difference :)
        'headless': false
    });
    const p = await b.newPage();
    await p.goto('https://w3c-test.org/media-source/mediasource-is-type-supported.html');
})();

barjin avatar Jul 07 '22 11:07 barjin

What's the reason of not using Google Chrome instead?

In general, I think it's good idea to cover all your tracks and plug all the holes. But besides that, I am not comfortable relying on only one browser to do all my scraping needs (too many eggs in one basket), and for better or for worse, large parts of the internet is still shut away if you're not Chrome - or at least, if you don't look like Chrome.

I understand if it's not as high of a priority as other items, but it still is a flaw to leave the API unpatched and I hope that it at least gets considered for later. Thanks!

JaneJeon avatar Jul 11 '22 21:07 JaneJeon