1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-29 14:17:11 +02:00
Commit Graph

31 Commits

Author SHA1 Message Date
Raymond Hill
1a082e0581
Expand parser's ability to process static extended filtering
This commit moves some of the parsing logic of static
extended filtering into the static filtering parser; this
allows better syntax highlighting and creation-time
error-catching for cosmetic, HTML, and scriptlet filters.
2020-06-13 08:48:56 -04:00
Raymond Hill
bc7f149252
Minor code review of static parser code 2020-06-09 11:58:27 -04:00
Raymond Hill
08eca13364
Visually emphasize regex-based pattern
To help prevent mistakenly creating regex-based
patterns.
2020-06-08 12:39:31 -04:00
Raymond Hill
01b1ed9a98
Add a new static filtering parser
A new standalone static filtering parser is introduced,
vAPI.StaticFilteringParser. It's purpose is to parse
line of text into representation suitable for
compiling filters. It can additionally serves for
syntax highlighting purpose.

As a side effect, this solves:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1038

This is a first draft, there are more work left to do
to further perfect the implementation and extend its
capabilities, especially those useful to assist filter
authors.

For the time being, this commits break line-continuation
syntax highlighting -- which was already flaky prior to
this commit anyway.
2020-06-04 07:18:54 -04:00
Raymond Hill
d462b50cec
Improve presentation of advanced settings page
Specifically:

- Fix exception being thrown when createing an
  empty line

- Syntax-color invalid setting names

- Syntax-color non-default values
2020-04-28 11:07:00 -04:00
Raymond Hill
051cb27f9b
Fix syntax highlighting of line continuation
Thix fixes an exception being thrown when the
line being continued is the last one.
2020-04-13 14:26:17 -04:00
Raymond Hill
ca80d2826b
Add indentation requirement for line continuation
Related commit:
- https://github.com/gorhill/uBlock/commit/703c525b01aa

This adds an indentation requirement for line
continuation to take place. The conditions are now
as follow:
- Current line ends with ` \`: ASCII space + backslash
- Next line starts with `    `: four ASCII spaces
2020-03-15 08:15:17 -04:00
Raymond Hill
703c525b01
Support line continuation in filter lists
If a line in a filter list ends with a space
(ASCII code 32) followed by a backslash
(ASCII code 92), those two characters will be
removed, the line will be trimmed and the next
line will be trimmed and concatenated to form
a new, longer line.

The purpose is to give filter list authors
a way to visually break apart unduly long
filters and thus make maintenance easier.

When line continuation is used, it is suggested
that the extra lines are prepended with four
space so as to make it more visually obvious that
the extra line(s) are the continuation of a
previous line.

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/943

The filter referenced in the above issue was the
motivation to implement this feature:
- https://hg.adblockplus.org/ruadlist/rev/f362910bc9a0

I verified and could not find any instance in major
filter lists of lines ending with ` \`, thus the
change should be safe.
2020-03-14 13:34:13 -04:00
Raymond Hill
2da8948928
Add basic syntax coloring to advanced settings pane 2019-12-24 10:04:18 -05:00
Raymond Hill
da253bf80c
Use type="search" for search input fields
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/768

So that the input fields can gain extra built-in
browser widgets useful in search fields.
2019-11-03 13:14:29 -05: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
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
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
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
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
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
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
72bbcdd93c
Prevent search expression in CodeMirror editor from crossing line boundaries
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/493
2019-04-23 19:26:02 -04:00
Raymond Hill
ac71d6577a
Visually emphasize directive syntax (!#if/!#endif) in list viewer/editor 2019-03-21 19:53:04 -03:00
Raymond Hill
388c1c98ec
Fix parsing of AdGuard's #$?#-based cosmetic filters
As reported in the following commit:
- https://github.com/AdguardTeam/AdguardFilters/commit/4fe02d73cee6
2019-03-05 10:10:40 -05:00
Raymond Hill
c192045e1d
fix https://github.com/uBlockOrigin/uBlock-issues/issues/264 2018-10-15 14:15:00 -03:00
Raymond Hill
224661f905
fix https://github.com/uBlockOrigin/uBlock-issues/issues/118 2018-07-09 15:21:45 -04:00
Raymond Hill
f764435812
various changes to enhance UI for mobile devices 2018-03-28 09:11:55 -04:00
Raymond Hill
6871d9aed4
add ability to filter out rules in "My rules" pane 2018-03-21 07:24:52 -04:00
Raymond Hill
a470c119aa
make options separator standout a bit better 2018-03-06 15:47:40 -05:00
Raymond Hill
7a90a69347
fine tuning syntax highlighter 2018-03-05 13:05:26 -05:00
Raymond Hill
9b803a2295
fine tuning syntax highlighter 2018-03-05 11:25:45 -05:00
Raymond Hill
2c45971c65
code review: fine tuning look/behavior (#3567) 2018-03-04 17:13:27 -05:00
Raymond Hill
c59ceff6a1
code review: always search from current cursor position (#3567) 2018-03-04 15:52:34 -05:00
Raymond Hill
bc61bef9a7
address #3567 2018-03-04 14:07:01 -05:00