Commit graph

2633 commits

Author SHA1 Message Date
Raymond Hill
104b222275
Revisit fix to https://github.com/uBlockOrigin/uBlock-issues/issues/627
The previous fix led to a regression. Related ffedback:
- 8d136ec2d5 (commitcomment-34460854)
2019-07-30 12:27:09 -04:00
Raymond Hill
f2ea0c6900
Import translation work from https://crowdin.com/project/ublock 2019-07-26 09:59:59 -04:00
Raymond Hill
048bfd251c
Add ability to bypass browser cache when fetching a resource
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/682#issuecomment-515197130

The following advanced setting has been added:

    updateAssetBypassBrowserCache

Default to `false`. If set to `true`, uBO will ensure the
browser cache is bypassed when fetching a remote resource.

This is for the convenience of filter list maintainers who
may want to test the latest version of their lists when
fetched from their remote location.
2019-07-26 09:52:11 -04:00
Raymond Hill
8d136ec2d5
Ignore pseudo-elements when querying selectors in element picker
Related issue:
- https://github.com/gorhill/uBlock/issues/2515
2019-07-26 09:24:34 -04:00
Raymond Hill
08c3f06160
Log :style(...) cosmetic filters only when there is a match
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/627
2019-07-23 11:42:04 -04:00
Raymond Hill
075d78e8e6
Remove trailing commas in function parameter lists
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/681
2019-07-22 17:38:23 -04:00
Raymond Hill
47cfba1551
Manually import df97249715 from 1.21.4
Related commit:
- https://github.com/gorhill/uBlock/commit/df972497156e
2019-07-22 06:30:00 -04:00
Raymond Hill
716aae4236
Reverting fix to https://github.com/gorhill/uBlock/issues/3639
Related feedback:
- a54cb2e38f (commitcomment-34387041)

Regression from converting uBO resources into
immutable resources. This affects only Chromium-based
browsers.

This is a quick fix for the dev build, to at least unbreak
the reported case.

I need to research whether the root issue (conflict with HTTPS-E)
is still occurring, and if so the fix is not trivial: I will need
to add code to uBO to fetch and convert binary data into `data:`
URIs.
2019-07-21 20:53:42 -04:00
Raymond Hill
066440534d
Prevent popup panel to close when forcing a tab reload
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/672

Additionally, this commit add the ability to press F5 to
force a reload while the popup panel is opened.
2019-07-21 11:50:15 -04:00
Raymond Hill
48347897ad
Remove obsolete ublock-resources-related code
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/679
2019-07-21 11:00:14 -04:00
Raymond Hill
e1dd7f7043
Ensure toolbar icon reflect updated whitelist directives
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/680

Opportunistically, vAPI.tabs has been refactored toward
ES6 syntax.
2019-07-21 10:48:44 -04:00
Raymond Hill
ecd81183b1
Fix thrown exception in onHeadersReceived listener
Regression from:
- https://github.com/gorhill/uBlock/commit/ae56c4dfe855
2019-07-19 10:02:27 -04:00
Raymond Hill
10fe9fe656
Allow setting assetsBootstrapLocation from admin settings
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/666
2019-07-18 10:53:08 -04:00
Raymond Hill
941f57e8f4
Import translation work from https://crowdin.com/project/ublock 2019-07-17 11:17:37 -04:00
Raymond Hill
3b0d214633
Mind escape sequences when validating :style filters
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/668
2019-07-13 07:49:07 -04:00
Raymond Hill
8d8336ffae
Remove useless return statement 2019-07-12 09:13:10 -04:00
Raymond Hill
d6927cf1fe
Ensure all members are initialized before loading selfie
Theoretically, if a selfie is loaded from corrupted
storage resulting in a thrown exception from the
constructor, this would cause an improperly initialized
HostnameBasedDB instance and overall potentially a
broken uBO.

Related feedback:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1543880#c7
2019-07-12 09:05:42 -04:00
Raymond Hill
ce644c5960
Remove code unused in next release
Since https://github.com/uBlockOrigin/uBlock-issues/issues/156
won't be fixed in next release, no need to ship
with code which will be unused, and anyways only once
the fix is worked on will it be clear exactly what needs
to be used by scriptlets to deal harmoniously with
property listener collisions.
2019-07-11 10:17:06 -04:00
Raymond Hill
9ef06da310
Minor code review re. https://github.com/uBlockOrigin/uBlock-issues/issues/658 2019-07-11 09:50:12 -04:00
Raymond Hill
80402d202a
Import translation work from https://crowdin.com/project/ublock 2019-07-10 17:29:48 -04:00
Raymond Hill
874e92af2d
Fix regression in URL rules validation
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/665

Regression:
- 2f63fb3fd4
2019-07-10 17:24:01 -04:00
Raymond Hill
b54522caa1
[scriptlet engine] Mind old scriptlet names not using .js
Related commit:
- 5552d6717d
2019-07-09 11:36:42 -04:00
Raymond Hill
5c449f59f2
[redirect engine] Use shorter name as the official name
- nobab.js => bab-defuser.js
- nofab.js => fuckadblock.js-3.2.0
2019-07-09 11:04:12 -04:00
Raymond Hill
fee217c59c
Fix regression introduced in 2f63fb3fd4
Related feedback:
- 2f63fb3fd4 (commitcomment-34222571)
2019-07-08 12:33:11 -04:00
Raymond Hill
2f63fb3fd4
Prevent adding known invalid URL-based rules
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/662#issuecomment-509220702

Currently, `doc` (aka `main_frame`) rules are not
evaluated to decide whether a network request must
be blocked or not, by design. This commits adjust
uBO's UI to account for this.
2019-07-08 10:49:53 -04:00
Raymond Hill
e55cae6232
Fine tune new resources-related code
Make sure the parser is safely compatible with old
resources format -- for those users still using
custom resources (via `userResourcesLocation`).

Prepare code for future fix to
<https://github.com/uBlockOrigin/uBlock-issues/issues/156>:

This commit introduces a new private Map() object,
`uBOSafe`, accessible by all injected scriptlets. This
private safe can be used to store data which can be shared
with different scriptlets. The idea is for scriptlets to
use that safe to graciously deal with the need to install
multiple listeners for the same property.
2019-07-08 08:56:36 -04:00
Raymond Hill
da4c4ded8d
Add a way to reload resources in dev build
Since resources are now immutable, by default they are
only compiled once each time uBO updates to a new
version. However I need a way to force a re-compiling
of the resource in the dev build. This commit adds code
to invalidate the resources selfie when forcing the
update of any filter list.
2019-07-08 08:41:28 -04:00
Raymond Hill
ad9b34bc7a
Code review of 9d1913a16e
Also eat backslash for `\\`, to allow searching for
literal `\n`, `\t`.
2019-07-07 07:52:37 -04:00
Raymond Hill
47a5caef54
Fix last newline not being automatically appended
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/657
2019-07-07 06:57:30 -04:00
Raymond Hill
9d1913a16e
Eat backslashes only for common control characters
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/658
2019-07-07 06:29:14 -04:00
Raymond Hill
2acaf3c433
Fix background color of previewed image in logger
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/c9u5xy/
2019-07-06 17:26:35 -04:00
Raymond Hill
6d2f66fef6
Import translation work from https://crowdin.com/project/ublock 2019-07-06 12:56:27 -04:00
Raymond Hill
6f5aa947fb
Finalize converting resources.txt into immutable resources
With hindsight, I revised decisions made earlier during
this development cycle:

Un-redirectable scriptlets have been removed from
/web_accessible_resources and instead put in the new
/assets/resources/scriptlets.js, which contains all
scriptlets used for web page injection purpose.

uBO will no longer fetch a remote version of built-in
resources.

Advanced setting `userResourcesLocation` will still be
honoured by uBO, and if set, will be fetched every
time at least one asset is updated.
2019-07-06 12:36:28 -04:00
Raymond Hill
ae56c4dfe8
Fix whitelist status evaluation of tabless network requests
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/651

The `behnind-the-scene` context was wrongly used to
evaluate the whitelist status of the context of tabless
network requests. The document origin must be used
instead when it's available.

Additionally, much code has been revisited for better
ES6 syntax compliance.
2019-07-05 17:44:08 -04:00
Raymond Hill
9693d07a6d
Code review of https://github.com/gorhill/uBlock/commit/f930da7ad64a 2019-07-05 12:33:14 -04:00
Raymond Hill
f930da7ad6
Fix regression of reverse-lookup of scriptlet filters in logger
Related commit:
- 5552d6717d
2019-07-05 11:44:40 -04:00
Raymond Hill
e107b6bcf1
Fix typo in comment 2019-07-05 10:32:19 -04:00
Raymond Hill
5552d6717d
Implement scriptlet token normalization
The goal is to be able to specify a scriptlet token
without the `.js` part at the end, because that part
is essentially redundant with the `+js` part of
the syntax.

When the next stable release is in widespread use
(to determine), scriptlet tokens will have to be
specified without the `.js` part, and with this
commit the logger will already report the normalized
version of scriptlets.

Eventually, when the migration to sans-`.js` is
complete (also to determine), the internal
normalization of the token will be removed and this
will become official syntax.

Filter list maintainers will have to mind that
uAssets is becoming in use beyond uBO (i.e. Brave)
when skipping the `.js` part -- hopefully Brave will
go along with the change here, which is to remove a
bit of tediousness for filter list maintainers.
2019-07-05 10:10:59 -04:00
Raymond Hill
6220e1d3eb
Add missing newline 2019-07-05 08:22:26 -04:00
Raymond Hill
3e53963be3
Fix window.open-defuser
Matching logic has been erronesouly reverse.
2019-07-05 07:59:02 -04:00
Raymond Hill
a992875c94
Save only modified immediate hidden settings 2019-07-05 07:33:09 -04:00
Raymond Hill
b3ea68a08d
Import translation work from https://crowdin.com/project/ublock 2019-07-04 15:50:20 -04:00
Raymond Hill
1fb9845c35
Remove useless code 2019-07-04 14:10:23 -04:00
Raymond Hill
f9e680f111
Convert more resources as immutable
Related commit:
- 152cea2dfe
2019-07-04 14:08:56 -04:00
Raymond Hill
8e245c8919
Convert more resources as immutable
Related commit:
- 152cea2dfe
2019-07-03 19:26:09 -04:00
Raymond Hill
0ba9a35818
Convert more resources as immutable
Related commit:
- 152cea2dfe
2019-07-03 14:33:06 -04:00
Raymond Hill
5672f54663
Import translation work from https://crowdin.com/project/ublock 2019-07-03 09:57:04 -04:00
Raymond Hill
152cea2dfe
Refactor management of injectable resources
This is a first step, the ultimate goal is to remove
the need for resources.txt, or at least to reduce to
only hotfixes or for trivial resources targeting very
specific websites.

Most resources will become immutable, i.e. they will
be part of uBO's code base. Advantages include easier
code maintenance (jshint, syntax highlight), and to
make scriptlets more easy to code review by external
parties (for example extension store reviewers).

TODO:

- More scriptlets need to be imported before next
  release.
- Need to make legacy versions of uBO use a legacy
  version of resources.txt, as all the now obsolete
  scriptlets will have to be removed once uBO's
  next release become widespread.
- Possibly need to add code to load binary
  resources so that they can be injected as
  data: URI. So far it's unclear whether this is
  really needed. For example, this would be needed
  if a xmlhttprequest is redirected to an image
  resource.
2019-07-03 09:47:56 -04:00
Raymond Hill
41636c59fb
Strict-block only if match is anchored to end of hostname
As per feedback from filter list maintainers.
2019-07-02 11:56:27 -04:00
Raymond Hill
2e04b75ccf
Import translation work from https://crowdin.com/project/ublock 2019-07-02 09:59:26 -04:00
Raymond Hill
730a83377e
Minor code review re. context menu code
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/151

I have been unsuccessful fixing the above issue, but I will
keep the changes made in the process of trying to fix it.
2019-07-02 09:43:26 -04:00
Raymond Hill
cdd1aac442
Add convenience link to network resources in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/648
2019-06-30 16:15:19 -04:00
Raymond Hill
2bcf671dae
Put back erroneously removed line
Regression from 1dfdc40e09
2019-06-30 12:54:05 -04:00
Raymond Hill
c8860ff61d
Code review of c1bdc123f2 2019-06-30 10:22:06 -04:00
Raymond Hill
1dfdc40e09
Add ability to suspend network request handler at will
This works only for platforms supporting the return of
Promise by network listeners, i.e. only Firefox at this
point.

When filter lists are reloaded[1], there is a small
time window in which some network requests which should
have normally been blocked are not being blocked
because the static network filtering engine may not
have yet loaded all the filters in memory

This is now addressed by suspending the network request
handler when filter lists are reloaded -- again, this
works only on supported platforms.

[1] Examples: when a filter list update session
    completes; when user filters change, when
    adding/removing filter lists.
2019-06-30 10:09:27 -04:00
Raymond Hill
c1bdc123f2
Fix use of sibling-related CSS syntax at prefix position
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/c6iem5/
2019-06-29 14:07:54 -04:00
Raymond Hill
b1ec593b9f
Import translation work from https://crowdin.com/project/ublock 2019-06-29 11:16:25 -04:00
Raymond Hill
cf4345ffc4
Fix some element picker-related issues
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/c5do7w/

Make the element picker better reflect network filters as
parsed by the static network filtering engine. Additionally,
discard single alphanumeric character-based filters.

Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/c62irc/

Inject newly created cosmetic filters into the DOM
filterer, in order for these filters to be enforced by
the DOM filterer in subsequent dynamic DOM changes.
2019-06-29 11:06:03 -04:00
Raymond Hill
dba075af59
Import translation work from https://crowdin.com/project/ublock 2019-06-28 06:27:53 -04:00
Raymond Hill
6c34b3c3c9
Use "relax" instead of "toggle"
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/371
2019-06-27 08:16:18 -04:00
Raymond Hill
388e5df5fd
Import translation work from https://crowdin.com/project/ublock 2019-06-27 08:14:48 -04:00
Raymond Hill
a9659d039d
Add missing command in manifest.json 2019-06-26 17:17:41 -04:00
Raymond Hill
f9c9c2cc14
Import translation work from https://crowdin.com/project/ublock 2019-06-26 10:20:31 -04:00
Raymond Hill
693687fd74
Add keyboard support for toggling down blocking profile
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/371

By default, no specific keyboard shortcut is predefined,
this will have to be assigned by the user. The command
name in English is "Toggle blocking profile".

The default behavior is to toggle down according to one
of the following scenarios.

a) If script execution is disabled through the no-scripting
switch, the no-scripting switch will be locally toggled
so as to allow script execution. The page will be
automatically reloaded.

b) If script execution is not blocked but the 3rd-party
script and/or frame cells are blocked, local no-op rules
will be set so as to no longer block 3rd-party scripts
and/or frames. The page will be automatically reloaded.

Given this, it may take more than one toggle down command
to reach the lowest blocking profile, which is one where
JavaScript execution is not blocked and 3rd-party scripts
and frames resources block rules, if any, are bypassed
with local no-op rules.

TODO: At this point, I haven't yet decided whether
toggling from the lowest profile should restore the
original highest blocking profile.
2019-06-26 07:47:14 -04:00
Raymond Hill
d1df2b5e73
Fix merging multiple URls in element picker
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/c5do7w/

Fixed:
- Expect the differ can return the first input as is when
  there is no difference between the two items.
- Better deal with extraneous whitespaces in `srcset`
2019-06-25 17:09:04 -04:00
Raymond Hill
9065bbdd48
Code review of whitelisting-related code
- Use `Map()` instead of `{}` for internal data
  structure
- Export as array of directives instead of as
  a string
2019-06-25 11:57:14 -04:00
Raymond Hill
8e7384ba84
Prevent duplicate inline-script entries in the logger
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/c4340z/filter_problem/ervpjd8/
2019-06-24 11:40:14 -04:00
Raymond Hill
ce94319e86
Import translation work from https://crowdin.com/project/ublock 2019-06-23 08:44:13 -04:00
Raymond Hill
41685f4cce
Replace exec with transpose in procedural filters
The purpose is to avoid having to iterate through
all input nodes at each operator implementation
level. The `transpose` method deals with only one
input node, and the iteration is performed by the
main procedural filtering entry points.

Additionally:
- Add `:spath` to HTML filtering
- Rename `:watch-attrs` to `:watch-attr`
  - `:watch=attrs` is deprecated and will be kept around
    until it is safe to remove it completely
2019-06-23 08:05:53 -04:00
Raymond Hill
570723f795
Import translation work from https://crowdin.com/project/ublock 2019-06-20 14:42:37 -04:00
Raymond Hill
b428a25c3f
Add new procedural operator: :min-text-length(x)
Where `x` is the minimal text length of the subject
DOM element. DOM elements whose text length is
greater than or equal to `x` will be selected.

The original rationale for such procedural cosmetic
operator[1] is to be able to remove inline script
elements according to a minimum text length using
HTML filtering.

[1] As a result of internal discussion with filter
    list maintainers @ uAssets.
2019-06-20 14:11:54 -04:00
Raymond Hill
822e0a133d
Provide visual feedback for invalid entries in "My rules"
Related issue:
- https://github.com/gorhill/uBlock/issues/1039
2019-06-19 18:28:44 -04:00
Raymond Hill
be2a950541
Code review of HNTrie/staticNetFilteringEngine
- Remove HNTrieContainer class from global context by
  storing it as a property of µBlock.

- Use block scope to isolate HNTrie-related constants
  from global context.

- Prevent filters which are pure IP address from
  being stored in an HNTrie instance -- as this
  could cause false positives.
2019-06-19 10:00:19 -04:00
Raymond Hill
7303776757
Use async/await in Matrix.benchmark() 2019-06-19 08:37:48 -04:00
Raymond Hill
cfc2ce333d
Implement bidirectional plain-string trie
The bidirectional trie allows storing the right
and left parts of a string into a trie given a
pivot position.

Releated issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/528

Additionally, the mandatory token-at-index-0 rule
for FilterPlainHnAnchored has been lifted, thus
allowing the engine to pick a potentially better token
at any position in the filter string.

***

TODO: Eventually rename `strie.js` to `biditrie.js`.

TODO: Fix dump() method, it currently only show the
      right-hand side of a filter string.
2019-06-18 19:16:39 -04:00
Raymond Hill
7e38391a71
Import new Bosnian translations from https://crowdin.com/project/ublock 2019-06-15 09:38:06 -04:00
Raymond Hill
5c05209e7f
Import translation work from https://crowdin.com/project/ublock 2019-06-14 10:59:07 -04:00
Raymond Hill
2a2faa84a0
Import translation work from https://crowdin.com/project/ublock 2019-06-05 08:19:12 -04:00
Raymond Hill
e9bbc33194
Import translation work from https://crowdin.com/project/ublock 2019-06-03 06:42:02 -04:00
Raymond Hill
2eb9b726a5
Fix generichide not being evaluated for local context
Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/5704
2019-06-03 06:37:39 -04:00
Raymond Hill
bd961364cc
Import new en-GB from https://crowdin.com/project/ublock 2019-05-31 09:30:32 -04:00
Raymond Hill
c312ec2cd5
Import translation work from https://crowdin.com/project/ublock 2019-05-31 09:17:16 -04:00
Raymond Hill
27e8c8d468
Normalize tabless xhr to image/media in onHeadersReceived()
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/610

The service worker-related issue affects both
Chromium/Firefox: the type of resources fetched
from a service worker are uniformly set to
`xmlhttprequest`, hence losing a key piece of
information for the purpose of accurate content
filtering.
2019-05-31 09:02:07 -04:00
Raymond Hill
a691d180f2
Import translation work from https://crowdin.com/project/ublock 2019-05-28 07:25:11 -04:00
Raymond Hill
8828522fe8
Fix errors with cosmetic filter exception in the logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/602
2019-05-28 07:21:16 -04:00
Raymond Hill
d99789e107
Import translation work from https://crowdin.com/project/ublock 2019-05-26 08:11:38 -04:00
Raymond Hill
85b89fbe63
Fix broken import-from-file in Whitelist pane
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/bt2d1f/
2019-05-26 08:03:44 -04:00
Raymond Hill
ede233abe7
Import translation work from https://crowdin.com/project/ublock 2019-05-25 10:09:53 -04:00
Raymond Hill
a7bfff03d6
Avoid spurious diff at edit time in "My rules"
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/593

The issue was caused by the lack of empty last line, since
the differ taking into account new line characters.
2019-05-25 10:04:31 -04:00
Raymond Hill
80a8750d35
Select existing "Advanced settings" page if any
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/591

Additionally, I added a link to the logger in the
"About" pane in the dashboard in order to be able
to access the logger without having to go through
the popup panel.
2019-05-25 08:31:06 -04:00
Raymond Hill
fb6d69f543
Discard whole filter with bad csp= content
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/bshn7z/

uBO was just removing the bad option, while the whole
filter needs to be discarded.
2019-05-24 15:41:37 -04:00
Raymond Hill
1e9528e2a6
Fix regression affecting *$csp=-like filters
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/bshn7z/filter_question/

Regression introduced in:
- 3f3a1543ea
2019-05-24 12:15:32 -04:00
Raymond Hill
26708b37c1
Integrate bare-bone filter hit stats in the logger
Related issue:
- https://github.com/gorhill/uBlock/issues/983
- https://github.com/gorhill/uBlock/issues/1353

The current implementation reports statistics for all
static filters, and the presentation/featureset is
intentionally minimal: *Do not open issues about this.*
It's still a work in progress and it will be worked on
slowly and thoughtfully over time and as time allows.

Pausing the logger will not pause the collation of
filter hit statistics, thus it is possible to lower
the logger overhead by pausing logger output without
losing filter hit collation.
2019-05-24 11:18:39 -04:00
Raymond Hill
64636a44cb
Import translation work from https://crowdin.com/project/ublock 2019-05-23 19:35:53 -04:00
Raymond Hill
eef76c49ae
Add a link to the remote asset in asset viewer
The link will be present if and only if the content
of the currently viewed asset has been fetched from
a remote location.
2019-05-23 19:29:59 -04:00
Raymond Hill
294ea41fde
Import emergency fix 5a29a21c81 in dev build 2019-05-23 10:22:51 -04:00
Raymond Hill
1f398134f9
Minor code reivew of 4430ec11e2 2019-05-23 08:15:26 -04:00
Raymond Hill
7b8c087fdd
Start using async/await where it makes sense 2019-05-22 19:23:04 -04:00
Raymond Hill
8d40d41cf7
Import translation work from https://crowdin.com/project/ublock 2019-05-22 18:07:08 -04:00
Raymond Hill
4430ec11e2
Rearrange inner loop of static network filtering engine
The motivations for the re-arrangement:

- Reducing the number of entry points:
  matchStringExactString() has been removed and
  matchString() is simply reused with a modifier parameter
  to enable matching variants.

- Presumption that most matches, if any, occur early with
  the left-most tokens in a URL. This gives a very small
  marginal performance gain as per built-in benchmark.
2019-05-22 17:51:03 -04:00