Commit graph

16 commits

Author SHA1 Message Date
Raymond Hill
a986b45433
[mv3] Fix gutter click on last line 2025-07-28 09:18:15 -04:00
Raymond Hill
9c08e902bd
[mv3] Fix regression in syntax highlighting of dark theme 2025-06-24 20:44:14 -04:00
Raymond Hill
d9aba4acca
[mv3] Use custom tokens for YAML document boundaries 2025-06-24 10:41:39 -04:00
Raymond Hill
e8fb0e1cc9
[mv3] Add ability to convert pasted filters to DNR rules
WHen a uBO static network filter is pasted into the "Custom DNR
rules" editor, it will be converted into a DNR rule whenever
possible. At the moment, no feedback is provided when the conversion
fails -- this will be improved in the future.
2025-06-22 09:44:32 -04:00
Raymond Hill
c1bd62ae24
[mv3] Start to implement better DNR rule assistant 2025-06-17 12:09:33 -04:00
Raymond Hill
28d2326808
[mv3] Better support for toggling line comments 2025-06-13 19:08:11 -04:00
Raymond Hill
786cf0c802
License stuff 2025-06-13 18:22:26 -04:00
Raymond Hill
9ee42b26c1
[mv3] Support toggling line comment using official CodeMirror command 2025-06-13 17:54:20 -04:00
Raymond Hill
b50341089d
[mv3] Expand "Develop" pane
Move "No filtering" section in "Settings" to "Develop" pane. It is
now possible to view/edit the list of hostnames for any of the
filtering mode. This takes care of these issues:
- https://github.com/uBlockOrigin/uBOL-home/issues/270
- https://github.com/uBlockOrigin/uBOL-home/issues/297

Add ability to see all rulesets (read-only), to assist in investigating
filtering issues.
2025-06-13 12:46:05 -04:00
Raymond Hill
0983e62437
[mv3] Fine tuning editor code 2025-06-01 14:34:57 -04:00
Raymond Hill
fad39c6ce5
[mv3] Add support for code-folding and use custom stream parser 2025-06-01 13:29:46 -04:00
Raymond Hill
670e8dc367
[mv3] Add smart spacebar/return auto completion 2025-05-31 09:42:53 -04:00
Raymond Hill
e1f2c6f88d
[mv3] Code review 2025-05-30 18:15:25 -04:00
Raymond Hill
ffb3fef073
[mv3] Add smart backspace in DNR rules editor 2025-05-30 11:23:45 -04:00
Raymond Hill
c142d9af67
[mv3] Fix dnr-parser for Safari compatibility 2025-05-29 14:33:30 -04:00
Raymond Hill
9339a75952
[mv3] Add support for custom DNR rules
This feature is hidden behind the "Developer mode" setting in
the dashboard. When "Developer mode" is enabled, a tab named
"Develop" will become available in the dashboard. This tab is
meant to contain tools for technical users.

At the moment, the "Develop" pane allows to create custom DNR
rules through a (CodeMirror-based) editor.

For the sake of convenience, the DNR rule must be entered in
YAML-like format. The format is not really full compliant YAML,
just YAML-like, and very strict in order to ensure the parser
stays simple enough.

Lines starting with `#` are comments and will be ignored by the
parser.

Any line which do not match the parser's expectation will be
marked as invalid, and the whole DNR rule containing such invalid
lines will be discarded.

There must not be empty lines inside a rule definition.

Each DNR rule must be separated with a `---` line, which is
known as a YAML document separator.

String values must not be quoted, otherwise the quotes will be
considered part of the value. There is one exception: `''` will
be parsed as "an empty string".

The editor will attempt to auto-complete known DNR keywords. That
feature will improve over time.

Though the parser will identify some errors, not all invalid DNR
rules are currently identified by the parser, and these will be
reported when the rules are registered through the DNR API. Better
identifying invalid DNR rules at edit time will improve over time.

The editor will report `regexFilter` values which are not
supported by the DNR engine on the current platform.

The editor reacts to instances of `regexFilter: ...` to report
whether a regex value is supported. This means you can test for
a regex value by using `# regexFilter: ...` so that you do not
have to create an actual DNR rules just for the sake of testing.

Custom DNR rules can be exported into a JSON file (a format
known by the DNR API as a "static ruleset").

JSON-based ruleset can be imported, the content will be converted
to YAML-like syntax.

The editor will attempt to convert to YAML pasted content which
can be JSON-parsed. It's possible to paste partially or wholly
JSON-based rulesets.

When disabling "Developer mode", all custom DNR rules will be
unregistered from the DNR API. The DNR rules content will be left
intact in such case. Existing DNR rules will be registered into
the DNR API when re-enabling "Developer mode".

Administrators can prevent "Developer mode" from being enabled
by adding `develop` token to `disabledFeatures` setting.

Related discussion:
https://github.com/uBlockOrigin/uBOL-home/discussions/323

The main motivation is to give list maintainers a tool to assist
with resolving filter issues. Custom DNR rules can assist in
crafting and validating filters meant to work with uBOL.

A secondary motivation is to provide technical users the ability
to further customize their content blocker.

More conveniences will be added over time, this is a first version.
2025-05-29 09:06:02 -04:00