Commit graph

7318 commits

Author SHA1 Message Date
Raymond Hill
158dfc165e
Make Firefox dev build auto-update 2019-06-30 10:28:56 -04:00
Raymond Hill
15192606d0
New revision for dev build 2019-06-30 10:24:30 -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
3a8608b49a
Fix typo in 0f318e9505 2019-06-29 11:44:46 -04:00
Raymond Hill
0f318e9505
Add unsupported cases to test pages
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/c6iem5/
2019-06-29 11:40:10 -04:00
Raymond Hill
fb3f8f99d6
Make Firefox dev build auto-update 2019-06-29 11:26:48 -04:00
Raymond Hill
50be7b7580
New revision for dev build 2019-06-29 11:18:56 -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
297c43e3a2
Make Firefox dev build auto-update 2019-06-27 08:22:55 -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
2d74b70b54
New revision for dev build 2019-06-27 07:33:38 -04:00
Raymond Hill
8d252c1643
Make Firefox dev build auto-update 2019-06-26 17:24:08 -04:00
Raymond Hill
b265edfac5
New revision for dev build 2019-06-26 17:20:45 -04:00
Raymond Hill
a9659d039d
Add missing command in manifest.json 2019-06-26 17:17:41 -04:00
Raymond Hill
c835c485d0
Make Firefox dev build auto-update 2019-06-26 10:55:30 -04:00
Raymond Hill
f9c9c2cc14
Import translation work from https://crowdin.com/project/ublock 2019-06-26 10:20:31 -04:00
Raymond Hill
7036ffcc13
New revision for dev build 2019-06-26 08:47:24 -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
5caa369229
Make Firefox dev build auto-update 2019-06-23 08:56:21 -04:00
Raymond Hill
ce94319e86
Import translation work from https://crowdin.com/project/ublock 2019-06-23 08:44:13 -04:00
Raymond Hill
7329a11f99
New revision for dev build 2019-06-23 08:35:15 -04:00
Raymond Hill
b0b43ad6b2
Add support to import en_GB description 2019-06-23 08:25:16 -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
4956a166d3
Make test pages small-screen friendly 2019-06-23 08:05:28 -04:00
Raymond Hill
a436102ff7
Add test case for :watch-attr 2019-06-22 16:41:42 -04:00
Raymond Hill
b2fb650279
Fix typos in test page 2019-06-22 12:38:00 -04:00
Raymond Hill
9def7f9c5d
Add tests for chaining with plain CSS syntax 2019-06-22 12:13:27 -04:00
Raymond Hill
b5397be601
Add link to parent page 2019-06-22 10:19:36 -04:00
Raymond Hill
10236552ca
Add test pages for procedural filters
Procedural cosmetic filters:
https://gorhill.github.io/uBlock/tests/procedural-cosmetic-filters.html

Procedural HTML filters:
https://gorhill.github.io/uBlock/tests/procedural-html-filters.html
2019-06-22 10:00:25 -04:00
Raymond Hill
d1a08af3ab
Make Firefox dev build auto-update 2019-06-20 14:57:22 -04:00
Raymond Hill
8847ac342d
New revision for dev build 2019-06-20 14:43:07 -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
793aca7ddb
Fix internal cosmetic filter being reported in the logger
Regression from:
- 62387fb87a

Repro steps were:
- Open the logger
- Navigate to `https://news.ycombinator.com/`
- Select an element using the element picker
- Click "Preview"

An attribute selector used internally by uBO to
hide targeted nodes was being reported in the
logger.
2019-06-20 07:14:34 -04:00
Raymond Hill
ca89a3895f
Make Firefox dev build auto-update 2019-06-19 18:44:02 -04:00
Raymond Hill
d405fb901b
New revision for dev build 2019-06-19 18:34:26 -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
b48176a964
Make Firefox dev build auto-update 2019-06-18 19:44:34 -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
4a062728ff
Fix https://github.com/uBlockOrigin/uBlock-issues/issues/638 2019-06-18 10:01:43 -04:00