Skip to content

Loading…

[Firefox] uBlock does not block element loaded via javascript (ABP does) #955

Open
ganego opened this Issue · 17 comments

5 participants

@ganego

So I recently wanted to block a certain video file that gets loaded via js but it does not work - in ABP it does. I also tried it with µBlock v0.8.9.3.

To reproduce:


a) The video seems to be loaded via a < video> tag in http://cdn2.younow.com/angularjsapp/build/younow.js?ver=3.201 (search for .mp4)
b) Using the traffic logger from your addon: the video does not show up
c) Using the traffic logger from firefox built-in devtools: the video does not show up (firefox bug?)
e) Using ABP and showing the hideable elements: the video does show up
f) Adding the video url to the ABP filter gets the video blocked

@gorhill

I don't get a request to http://cdn2.younow.com/angularjsapp/src/assets/animations/intro-video.mp4 when I go to the site. I get a "Sign in and get started!" thing.

Also, at point 4 you say "add the intro-video.mp4 url to the filter": can you tell me exactly what is that "intro-video.mp4" filter? And where do you add it exactly? The details need to be spelled out.

So first step, you need to tell me how to get that http://cdn2.younow.com/angularjsapp/src/assets/animations/intro-video.mp4 network request, it's not happening on my side.

@ganego

See this image for the steps I explain now: http://imgur.com/I7pC93S

  • When you go on that website for the dance tag ignore the sign in stuff (just close it) and just click on a channel (you need several sites whitelisted if you use noscipt or you won't see them).
  • Then (sometimes) to enter a channel you have to click on the 'enter live chat' button under the little video window to the right, to enter a stream.
  • When a stream opens, you will get this short intro video (click on my video link above to see what I mean - this is the video) - then after this video the real stream starts.

I added exactly this url to uBlock filter: http://cdn2.younow.com/angularjsapp/src/assets/animations/intro-video.mp4

And yes you do not see that networkrequest either via your addon nor through the built-in devtools from Firefox (devtools -> network).
ABP shows it in the loaded elements and blocking works.

@gorhill

Ok, finally I could get that http://cdn2.younow.com/angularjsapp/src/assets/animations/intro-video.mp4 by clicking a link in the "Trending People" section.

I added http://cdn2.younow.com/angularjsapp/src/assets/animations/intro-video.mp4 as is in the "Your filters" pane, and tried again. uBlock showed the request blocked, and so did the developer console in Chromium.

On Firefox, I am completely unable to see any request in the network traffic which ends with intro-video.mp4, whether with uBlock's logger, or whether with Firefox network pane in the dev console.

@ganego

Just realized I forgot to write which browser I use in the first post. I thought I did that but I forgot somehow. I'm Sorry.
Firefox 39 Nightly on W7x64.

Yes indeed it does not show up in the dev console of FF - so I guess your addon uses those functions, but ABP does something different?

@gorhill

All network requests are supposed to be intercepted, so will have to find out why this one is not. That would seem a trivial thing to do if it wasn't for the fact that Firefox doesn't see it either.

@gorhill gorhill changed the title from uBlock does not block element loaded via javascript (ABP does) to [Firefox] uBlock does not block element loaded via javascript (ABP does)
@gorhill

I see the video tag in the DOM but it's removed quickly, I have no time to inspect it. Still, I would expect a network request for the remote resource to occur, I can't see any for that mp4 video.

@chrisaljoudi
Owner

@gorhill I was able to reverse-engineer the JavaScript and stop the video element from being removed. Here it is in the inspector:

video elm

@gorhill

How is it on Safari? Can you see it through network traffic and block it just fine?

@chrisaljoudi
Owner

@gorhill yep, it works exactly as expected on Safari.

safari captures it fine

@chrisaljoudi
Owner

@gorhill by the way, this is some info about the video element from the Firefox console:

info

This tells me Firefox is indeed using that as a src, but for some reason it doesn't seem to show up in Firefox's network request logger. Wonder if Firefox is screwing up caching...

@chrisaljoudi
Owner

@gorhill more updates.

I can definitely confirm that part of this is how Firefox does caching. It appears that once you have the video cached, it doesn't show up in Firefox's network request log anymore.

I get the request in Firefox's logger just fine after a hard clear of the caches:

Firefox seems to be mean

However, µBlock doesn't see the request even then, which leads me to believe there's a missing hook somewhere on how µBlock attaches handlers to intercept requests.

Edit: actually, it does show up in µBlock after a hard cache reset.

@Deathamns

It's even worse for me, it shows that it blocked the request (it even reached the channel.cancel(this.ABORT); line, I checked), but it still loads the content.

@gorhill

If I re-launch Firefox, I can get the network request in the log. If there is a filter, it shows as blocked in the log. However, it plays in the browser. Also, I won't ever see again the network request afterward. Clearing the browser cache does not bring the network request back. Only re-launching Firefox I can see it again, once.

Edit: correction, I can see it in the log all the time now. No need to relaunch the browser. Blocked, yet still play in the browser.

@gorhill gorhill added available and removed investigating labels
@tntc4

I have the same issue.
1. go to http://www.telerik.com/
2. a huge video is loaded via tag on the front page
I added ||d585tldpucybw.cloudfront.net/telerik-videos/* to the "My filters" tab but the video still loads

using FireFox 36.0 and uBlock 0.9.2.3

edit:
after close and reopen Firefox, the video is no longer loads.
I want to propose in the future not to try to remove tag but to intercept requests and stop them.

@gorhill

I want to propose in the future not to try to remove tag but to intercept requests and stop them

That's what uBlock does, just look at the code.

@gorhill

Saw this comment from Giorgio Maone regarding what looks like a similar situation:

As far as I can see, the playing movie stream is nowhere to be found in the HTTP traffic, so they're currently streaming it only through the unsupported, Adobe-proprietary RTMP protocol, as therube hinted

@gorhill

About http://www.telerik.com/:

Filter ||d585tldpucybw.cloudfront.net/telerik-videos/tlrk_home230720141733.* works for Chromium, does not work for Firefox.

For Firefox, the resource shows as being blocked in uBlock's request log, does not show as not being fetched in Firefox's network log, and yet the video is apparently still downloaded and played. Looks like a Firefox bug to me.

@ahmadassaf ahmadassaf pushed a commit to ahmadassaf/uBlock that referenced this issue
@gorhill gorhill this hopefully fixes #955 cb1a176
@ahmadassaf ahmadassaf pushed a commit to ahmadassaf/uBlock that referenced this issue
@gorhill gorhill #955: merging 1.3.6 changes 7fcb017
@ahmadassaf ahmadassaf added a commit to ahmadassaf/uBlock that referenced this issue
@ahmadassaf ahmadassaf Merge branch 'master' of https://github.com/gorhill/uBlock
* 'master' of https://github.com/gorhill/uBlock: (24 commits)
  reverting last change
  code review
  new redirect engine: this fixes #949 (the video ad part)
  this fixes #959
  this takes care of last-resort ads
  will wait for fix of travis-ci/travis-ci#5145
  still trying to fix travis
  trying to fix travis' automated build
  new revision for dev build
  #955: merging 1.3.6 changes
  this hopefully fixes #955
  translation work from https://crowdin.com/project/ublock
  this fixes #951
  new revision for dev build
  #948: undo first attempt at fix
  reportedly this fixes #948
  this fixes #948
  #948: this possibly addresses the 1st reported error case
  bump version for dev build
  this addresses #909
  ...
7a1f6f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.