Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitch.tv - anti-ad blocker, video player (desktop: homepage) #2

Open
lukemulks opened this issue Jan 27, 2017 · 4 comments
Open

Twitch.tv - anti-ad blocker, video player (desktop: homepage) #2

lukemulks opened this issue Jan 27, 2017 · 4 comments
Assignees
Labels
bug

Comments

@lukemulks
Copy link
Collaborator

@lukemulks lukemulks commented Jan 27, 2017

Migrated from brave/browser-laptop#6872

Issue: twitch.tv video player locks up and displays a black overlay on the video player with shields up.
https://www.twitch.tv

Determined root cause & blacklist-tested:

Twitch.tv is using cloudfront to load a script that detects ad blocking:
https://d2lv4zbk7v5f93.cloudfront.net/esf.js

Blacklist rule that worked (via Charles Proxy blacklisting)
https://cloudfront.net/esf.js

Confirmed that blacklisting using this method of wildcarding around Cloudfront did the trick, and blocking behavior resumed once I removed the blacklisting rule.

@bbondy I believe the blacklist rule I applied in Charles Proxy would translate to the unbreak list as:

@@||cloudfront.net/esf.js$domain=twitch.tv

Happy to review/QA/confirm.

Sorry if this is dense, but would you rather me submit issues and propose fixes in this format, or branch & PR? Not sure what's preferred for these cases. (I come from submitting issues to devs over email behind closed gardens)

@bbondy
Copy link
Member

@bbondy bbondy commented Jan 27, 2017

@lukemulks you're awesome!

@bbondy bbondy closed this Jan 27, 2017
bbondy added a commit that referenced this issue Jan 27, 2017
@bbondy
Copy link
Member

@bbondy bbondy commented Jan 27, 2017

Fixed and confirmed it works with @lukemulks 's rule:
||cloudfront.net/esf.js$domain=twitch.tv

I'll upload data files so people will get this within a few hours.

@lukemulks
Copy link
Collaborator Author

@lukemulks lukemulks commented Jan 27, 2017

@lukemulks lukemulks reopened this Jan 28, 2017
@lukemulks
Copy link
Collaborator Author

@lukemulks lukemulks commented Jan 28, 2017

@bbondy still working on this issue, as we're both seeing intermittent player blocking.

I discovered these two ad requests making it beyond blocking shields.

Request 1: This is a custom ad script that Twitch uses, proxied via Fastly:
https://0914.global.ssl.fastly.net/ad/script/x.js?cb=148554633893

I believe this would be the rule to block the script above. The query string w/the cb= parameter pair passes a random value that works to cachebust the ad request. I left the query string off the rule in this case, but wanted to mention.

||fastly.net/ad/script/x.js$domain=twitch.tv

Request 2: Google's IMA SDK Adapter (portable - typically included in a creative XML payload in response to an ad request): https://imasdk.googleapis.com/js/sdkloader/ima3.js?_=1485550473643

I was really surprised to see this get by, because this is the call for the Google "portable" IMA SDK Adapter that's typically reserved for the XML manifest served in response to the ad request, and not in the ad request itself.

I suspect this may be either a bug, or a Twitch.tv player hack that loads when ad blocking is detected, but am having a hard time confirming if this is the case because when I blacklist it works some, but not all of the time.

Easylist has a blocking rule for this already that I suspect should be working, but I'm seeing it in network traffic, and it doesn't appear to be a stub/fake object from a 307 redirect that would be expected w/the gpt.js rule.

Easylist already is blocking w/this rule:
||imasdk.googleapis.com^$third-party

The request I'm seeing has a query string append that appears atypical: _=1485550473643 where I'd expect to see c=1485550473643

Will put more time in on figuring this out, but wanted to get the above here as an update until I can put fresh eyes on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.