segment-boneyard / nightmare

A high-level browser automation library.
https://open.segment.com
19.54k stars 1.08k forks source link

disable webRTC #1542

Closed TasDePixels closed 5 years ago

TasDePixels commented 5 years ago

Hello, is there a way to block webRTC in nightmare ? i know for a fact that there's a method in electron for that :

https://electronjs.org/docs/api/web-contents#contentssetwebrtciphandlingpolicypolicy

Setting the WebRTC IP handling policy allows you to control which IPs are exposed via WebRTC. See BrowserLeaks for more details.

any possible workaround ?

TasDePixels commented 5 years ago

Found it. turns out, you can actually access electron's methods through Nightmare.action(). Untitled-1

it works perfectly.