New filter type option for WebSockets · 2016-09-21 14:30 by Wladimir Palant
Starting with Adblock Plus 1.12.2 for Chrome, Opera and Safari we can block connections initiated via WebSockets on all major platforms (this functionality was available on Firefox since the very start). However, we didn’t have a special type for these requests as these were listed with type “other” instead. The assumption was that the protocol
wss:// would be sufficient for filter list authors in order to target WebSocket connections specifically. However, we received feedback that this wasn’t the case.
So with the current development builds (Adblock Plus 22.214.171.12402 for Firefox and Adblock Plus 126.96.36.1995 for Google Chrome, Opera and Safari) WebSocket connections are listed with the new type “websocket.” Consequently, filters can be made to target such connections specifically by adding
$websocket type option. Existing filters will have to be duplicated for now:
This syntax will support both new and old Adblock Plus versions as long as the versions without support for the “websocket” type are still common (these will ignore the first filter).
Edit (2016-09-22): This post was originally suggesting specifying both
other options on one filter. This approach will not work in Adblock Plus versions without support for the
websocket option because filters with unknown options are ignored.
Commenting is closed for this article.