Closed gorhill closed 9 years ago
webRequest.onBeforeRequest
overhead after re-factoring to support broader dynamic filtering (last lines reported after completing reference benchmark once):
µBlock> onBeforeRequest: 0.132 ms (8599 samples)
µBlock> onBeforeRequest: 0.132 ms (8649 samples)
µBlock> onBeforeRequest: 0.132 ms (8698 samples)
µBlock> onBeforeRequest: 0.132 ms (8763 samples)
µBlock> onBeforeRequest: 0.132 ms (8815 samples)
µBlock> onBeforeRequest: 0.132 ms (8894 samples)
µBlock> onBeforeRequest: 0.132 ms (8969 samples)
µBlock> onBeforeRequest: 0.132 ms (9025 samples)
µBlock> onBeforeRequest: 0.131 ms (9154 samples)
µBlock> onBeforeRequest: 0.131 ms (9169 samples)
µBlock> onBeforeRequest: 0.131 ms (9266 samples)
µBlock> onBeforeRequest: 0.131 ms (9271 samples)
New plumbing code works fine now.
Test case for issue #358:
disqus.com
, google.com
, googlesyndication.com
, outbrain.com
, twitter.com
, youtube.com
were blocked (great)youtube.com
here -- globally (pic) or just site-specific, user chooseiframe
from disqus.com
, google.com
, googlesyndication.com
, outbrain.com
, twitter.com
still blocked (great), embedded Youtube video now plays just fine while still filtered through static filtering (great)Three columns:
A cell can have one of four states:
The +
and -
sign in the site-specific columns provides an overview of the number of requests, allowed or blocked respectively, which where made for a specific hostname. One +
means the number of requests was in the single-digit range i.e. less than 10, ++
means the number of requests were in the doulbe-digit range, while +++
means 100 or more.
Case: take control of your privacy in your own hands
twitter.com
now knows you went to wired.com (see request to platform.twitter.com
)twitter.com
blockedtwitter.com
when on twitter.comtwitter.com
when on twitter.com -- static network filtering will still take placetwitter.com
will be made outside twitter.com, so you are no longer leaking browsing history to ubiquitous Twitter.twitter.com
when on twitter.com, you can create an exception for twitter.com
for any other web site where you do not mind having Twitter available.Case: un-breaking sites broken by some overzealous filters in one of the (static) filter lists.
boldchat.com
(I don't know the reason).boldchat.com
were blocked, which obviously is an issue when visiting boldchat.comboldchat.com
were blocked (the −−
).allow
dynamic rule (green)allow
rule was created for boldchat.com
for when visiting a web page on boldchat.com: it overrides whatever block filters in effect.boldchat.com
allow
rule (green), means: unconditionally allow requests, i.e. override any existing static block filters, or any more generic dynamic block rules (like the blocking of 3rd-party frames, etc)Being able to see the log of net requests and the why they were allowed/blocked is really a PITA currently, which is something an advanced user of dynamic filtering will want to have (I do) -- as one of its purpose is to un-break broken sites. As part of this major feature, I will provide the ability to see net requests in real time from a developer tool panel.
Being able to see all at once is definitely a huge improvement for mroe advanced users:
Unsure though if/how the dev tool pane can be ported to Firefox. There is really only one platform specific call to create the pane, all the rest is platform independent, so the pane could be in an iframe
on the target page, or a separate tab. Will see what @Deathamns think of this.
Never mind, using devtools API was non-trivial with regard to portability. And I could not solve it, facing a systematic whole browser crash when trying to solve in the proper manner. In the end, I went with a fully portable mechanism. Currently network request logger will have its own separate tab, which a user can detach so that he can observe the flow of network requests in real time. Down the road, it is also easily embed-able into a existing tab (in an iframe) through a mini content script if ever we want to sort-of mimic devtools, except that this will also work for Firefox (as far as I understand).
Can you consider to add filter name to the filter list, in the dev tools. This will help the users themselves to identify, the culprit filter list and report it to the filter list maintainers appropriately.
Can you consider to add filter name to the filter list
I guess you meant "to add filter list to the filter name". Dup of #43. Not trivial unless one doesn't mind sacrificing efficiency. I mind. So far a reverse lookup is what I have in mind. Only those who care to find the list will incur a resource cost.
Ok Thanks. I agree, efficiency comes first. This is just a trivial case in-terms of usability.
Just to note, IMO, it's almost mandatory to warn the user that the flip of a given option will consume additional, non trivial, resources.
What option?
"..of a given option.." = any option.
Just wanted to note this for the future, so that the efficiency can (and should IMO) be controlled by the user, but in a consciously way of any effect of each option that is offered to him.
No worry, I don't plan to depart from what has been among top priorities since the beginning.
Just keeping track, given code change:
µBlock> onBeforeRequest: 0.123 ms (9201 samples)
µBlock> onBeforeRequest: 0.123 ms (9274 samples)
µBlock> onBeforeRequest: 0.123 ms (9361 samples)
µBlock> onBeforeRequest: 0.123 ms (9411 samples)
µBlock> onBeforeRequest: 0.122 ms (9575 samples)
µBlock> onBeforeRequest: 0.122 ms (9590 samples)
µBlock> onBeforeRequest: 0.123 ms (9741 samples)
µBlock> onBeforeRequest: 0.123 ms (9764 samples)
µBlock> onBeforeRequest: 0.123 ms (9794 samples)
µBlock> onBeforeRequest: 0.123 ms (9854 samples)
Fixed in 0.8.5.0.
To address one way or another various filed issues: #361, #358, #331, #282, #236, #68.
Definitions:
Filtering:
Filtering precedence inside dynamic filtering -- most specific to least specific:
UI:
script
,iframe
) to address the issues enumerated above.