ABP extension breaks webrtc websites

Everything about using Adblock Plus on Google Chrome
Post Reply
dbriggs
Posts: 1
Joined: Tue Apr 24, 2018 2:22 am

ABP extension breaks webrtc websites

Post by dbriggs »

Description
ABP chrome extension (version 3.0.3) appears to break video conversation websites that use webrtc with the adapter.js library. As far as I know, most webrtc websites use the adapter.js library, so this is a big problem. Here is the webrtc adapterjs library for reference: library: https://github.com/webrtc/adapter.


Details
ABP Version: 3.0.3
Browser: Chrome 65.0.3325.181 (Official Build) (64-bit)
Device: Mac OS High Sierra 10.13.4 (Also occurs on Windows 10 64-bit machine)
Default settings/config.


Steps to reproduce
1. Open Chrome
2. Install the ABP chrome extension
3. Navigate to https://webrtc.github.io/samples/src/co ... ickle-ice/
4. Open chrome dev tools
5. Click "Gather Candidates" at the bottom of the page.
6. Refresh the page and click "Gather Candidates" again. Continue to do this several times. You should get an error in the console after a couple refreshes. Then you will get it every time. If you do a hard reload it should remove the issue, but it will reappear after a normal refresh.

This is the error I am getting on my Mac and Windows machines:

Code: Select all

adapter-latest.js:3228 Uncaught TypeError: Cannot assign to read only property 'iceServers' of object '#<Object>'

Thoughts
My guess is that the issue was introduced by this commit (but it's just a guess!):
https://github.com/adblockplus/adblockp ... c4ff593492.

I can only reproduce the issue when using the adapter.js library and ABP. I imagine this is because both libraries modify the window.RTCPeerConnection object. I didn't look too much into the ABP code but I imagine the goal of the webrtc code is to prevent ads from being served over peer connections. Thats fine, but its not good it if breaks websites that are using webrtc for video conversations as well.

Let me know if I can provide any more detail! Happy to help :)

Dan
mlegendre
Posts: 1
Joined: Thu Sep 27, 2018 6:48 pm

Re: ABP extension breaks webrtc websites

Post by mlegendre »

I had the same issue with adapter.js, and it is fixed in the current version (6.4.0). (See https://github.com/webrtcHacks/adapter/issues/831)

Details : adapter.js sets up a wrapper around the window.RTCPeerConnection function that modifies its arguments, but ABP also sets up a wrapper (in include.preload.js) that makes those arguments read-only. So adapter.js ends up wrapping the ABP "hardened" wrapper, hence the TypeError.

Maybe the behaviour of adapter.js was questionnable in the first place, but it also seems questionnable to me that ABP sets up this wrapper regardless of filters, and even if it is paused on the page, or globally.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: ABP extension breaks webrtc websites

Post by mapx »

You could report here:
https://issues.adblockplus.org
Post Reply