Inject `MediaSource` API to hide codec support
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
I think this makes sense, otherwise, this "lie" could be easily detected.
What's the reason of not using Google Chrome instead?
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');
})();
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!