Why AdLock Extension for Google Chrome Fails to Block Ads on Twitch

Twitch.tv is known for its variety of entertaining content for every taste and age but in the purchase of easy money, advertisers and marketers have turned it into a nut-box house. Forlornly, viewers seek salvation in diverse adblockers — from lightweight extensions to full-fledged applications. Twitch.tv constantly cooks up and introduces new types of commercials that need to be studied and understood. Recently, irate at adblocking extensions for Google Chrome users pushed the panic on numerous forums. Let’s dive into the topic and consider, why adblocking extensions fail to block ads on Twitch.

Twitch introduced new mid-roll ads a few weeks ago and since then they’ve been more than frustrating for both streamers and viewers. We’re ready to announce, that the new adverts on Twitch are officially beaten.

Into the Matter

AdLock Chrome extension uses the webRequest API to remove commercial content injected into the web page. This API offers an opportunity to add a handler at different stages of an HTTP request to analyze, redirect, and block advertising and malicious requests. At the same time, webRequest API is heavily restricted when working with filtering rules, which significantly limits the content filtering capabilities of browser extensions comparing to other AdLock products (AdLock Windows, AdLock Android, and AdLock Mac).

One of the most significant restrictions is the prohibition on modifying the body of HTTP responses (at the moment support for modifying is available only in Firefox and is already implemented in AdLock Firefox so you can try it out right now). This limitation prevents the AdLock Chrome Extension from using some of the rules for modifying a web page before it reaches the browser.

The HTTP response can contain both useful and advertising content in the body. The only way to cut out the advertising part is to change it before being displayed to the user.

Let’s see how that works:

Twitch.tv is an extremely popular video streaming platform with a broad audience. Advertisements on Twitch come embedded in the same stream with the video, which makes it impossible to block such a request with the basic filtering rules, as it would result in blocking of the whole video stream.

Filtering rules with the $replace modifier, supported by the installable apps — AdLock Windows, Android, and Mac, fight this type of advertising perfectly fine, as they have the ability to modify the content at the network level.

Using the rule with the $replace modifier applied to the request, a certain part of the page is replaced even before the browser had time to receive the HTTP response and draw the DOM tree. After that, no advertising requests remain on the page, which prevents the broadcast of the advertising video.

||example.com^$ replace = / A / B /

Using the rule above, AdLock application processes the in the body of the response from example.com, and by the regular expression “A”, replaces traced commercial content with the modifier “B”. Then AdLock sends the modified response to the browser.

||example.com^$ replace = / A / B /

Getting back to the restrictions we mentioned, HTML content filtering rules are not available for the AdLock Chrome Extension but are supported by other AdLock products. These rules allow modifying the HTML code of the page before it reaches the browser without replacing a certain part but specifying which HTML elements should be completely removed from the code.

[domains] “$$” tagName [attributes]

Using these rules, the application first matches the domain of the browser page with the names of the [domains] rule, then finds all tags specified in the tagName rule and removes those that match the [attributes] criteria described in the rule. Then the user is shown a page without advertising content.

[domains] _$$_ tagName [attributes]

So, What’s the Conclusion?

AdLock extension for Chrome works perfectly fine in fighting diverse types of adverts across the web but is restricted in processing in-built video stream commercials on Twitch.

So, if it’s too complicated to understand, we tell straight: if you want to enjoy Twitch without commercials, you should use a full-fledged adblocking application. Download AdLock for Windows and install it. Basically, that’s it. AdLock will block not only ads on Twitch but all kinds of ads in all your favorite browsers and software you have on your PC. Our application is set up to stop all types of commercial content across the system and accessorial software by default, but you can adjust settings to meet your needs.

 

 

Do you like this post? Share it!
Kostya Shebanov

Kostya Shebanov

Product Owner at Hankuper s.r.o., Proud dad.!!! Led by knowledge, insight, and a pool of fresh ideas, Kostiantyn is a spectacular example of an inexhaustive leader. Outside of business, he is an energetic outdoorsman loving to hang out with family and friends. He doesn’t shirk to share his knowledge in the AdLock blog, so stay tuned.

GET ADLOCK FOR YOUR DEVICE