Skip to content

Loading…

When downloading a file from any site, uBlock "forgets" the current page #516

Closed
Mikey1993 opened this Issue · 4 comments

2 participants

@Mikey1993

Steps

1) Enter any downloading site, for example: http://www61.zippyshare.com/v/69937853/file.html
2) See that uBlock blocks X number or requsts.
3) Hit the "DOWNLOAD NOW" button to download.
4) Observe that uBlock now has Y number of requests blocked.

The URL of the page didn't changed, which means that uBlock is not aware that the request came from the same page, and accounts it as a new loading of a page.

This happens absolutely on every site that I have checked when trying to download a file.

Shouldn't uBlock know that the request happened from the given page, and just add it to the current list of page requests?

An interesting thought:
What will happen if we enter a given site, and then download a file, which will change the context of the page to the download domain, but after some time the current page will have a request that should be blocked by uBlock. will it be blocked?

*Note: uMatrix also has this behaviour.

@gorhill

I need to listen to and bind from onBeforeNavigate.

The binding of the tab in onBeforeRequest will be a weak one, i.e. it will be there as a last resort for tabs which for whatever reason may not have been bound yet. If they are found to be already bound, no re-binding will occur.

@gorhill gorhill added a commit that closed this issue
@gorhill gorhill this fixes #516 3ab9aa4
@gorhill gorhill closed this in 3ab9aa4
@Mikey1993

Why the download URL accounts for main_frame in the statistics?
Isn't it should be an object?

Tried the same steps above with the uBlock 0.8.5.5 which got the fix.

@gorhill

Isn't it should be an object?

uBlock just reports what the browser told it. The download operation is reported by the browser as a main_frame request, hence it is reported as main_frame.

Edit: Both Chromium/Firefox reports the download request as main_frame.

@Mikey1993

Hmm.. I see, so this will make it a bit more tricky to identify the initial load row in the statistics of the inspected page (when comparing 2 run of loading the same page for comparison, as mentioned in #483 )

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.