0

I was trying to disable webRTC in Chromium for the past few hours unsuccessfully. I would like to solve it without using extensions for headless: true by either modifying the right files in puppeteer-bundled chromium or with launch arguments if that is possible? So far I was unable to pass the test at browserleaks.com/webrtc

Is there an easy way I can implement this every time I use puppeteer in my projects?

Edit: When headless:false this can be solved by loading in local extensions. However there seem to not be simple solution equivalent to adding arguments when headless:true.

miyagisan
  • 805
  • 1
  • 9
  • 19
  • This seems [not to be possible](https://superuser.com/a/1060042/1003466) anymore. You might checkout [this answer](https://stackoverflow.com/a/53021396/5627599) for information on how to do it with an extension. Maybe it is possible with `puppeteer-firefox`. – Thomas Dondorf Apr 05 '19 at 17:59
  • @ThomasDondorf: Thank you for your reply. Did I understand you correctly that I can only load an extension that does it in headless:false but it will continue to leak in headless:true? I am having a hard time understanding the purpose of automating web crawling with puppeteer without preventing webrtc leaking true IP when using proxies? – miyagisan Apr 05 '19 at 18:06
  • Yes, that is correct. Chromium only supports extensions in non-headless mode. I'm not aware of any solutions regarding WebRTC leaks. – Thomas Dondorf Apr 05 '19 at 18:42
  • Possible duplicate of [How can I disable webRTC local IP leak with puppeteer?](https://stackoverflow.com/questions/53017490/how-can-i-disable-webrtc-local-ip-leak-with-puppeteer) – Md. Abu Taher Apr 06 '19 at 08:04
  • Just adding a duplication note even though it links to same answer. – Md. Abu Taher Apr 06 '19 at 08:05
  • @Md.AbuTaher: That works only when headless: false, I think both posts were originally looking for solution when headless: true. Sadly there seem not to be a simple and clean way to do it via settings or flags without hacking at the code evaluations or intercepting scripts. – miyagisan Apr 06 '19 at 12:32
  • I researched about the flags multiple times without results, I'll update this answer if i get any good news. – Md. Abu Taher Apr 06 '19 at 13:14

1 Answers1

1

If you are online concerned about the IP leak, you can use --force-webrtc-ip-handling-policy=default_public_interface_only on the command line.

If you are writing a Chromium based application, you need to set the policy in content::RendererPreferences webrtc_ip_handling_policy

Allan Jensen
  • 518
  • 4
  • 8