1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00
Commit Graph

57 Commits

Author SHA1 Message Date
Raymond Hill
46ea5519c1
Add checkboxes to "My filters" pane
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/3161
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2895#discussioncomment-8504374

Two checkboxes have been added to the "My filters "pane:

1. A checkbox to wholly disable/enable "My filters". This is equivalent
   to the checkbox for "My filters" in "Filter lists" pane.

2. A checkbox to enable/disable the trustworthiness of the content
   of "My filters". Default to untrusted.

Since toggling these checkboxes requires reloading all filter lists,
their new state must be committed through the "Apply changes" button.

Additionally: a "book" icon has been added to the top-right of the
dashboard, which is a link to the wiki according to whichever pane is
currently active.
2024-03-11 11:39:31 -04:00
Raymond Hill
fef26e234d
Make the "untrusted sources" warning always visible
It won't disappear when vertical space is restricted.
2024-02-18 08:00:34 -05:00
Raymond Hill
ee83a4304a
Isolate DOM inspector layers from page context
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/1411

Additionally, refactored communication mechanism between content
script contexts and uBO contexts by using MessageChannel/BroadcastChannel
web APIs.
2023-12-03 16:21:32 -05:00
Raymond Hill
e351551dc4
Move warning sentence to the start
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2895#discussioncomment-7353454
2023-10-23 10:01:33 -04:00
Raymond Hill
589f281f21
Fine tune CSS
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2895#discussioncomment-7353182
2023-10-22 18:33:28 -04:00
Raymond Hill
1e745c2f4d
Emphasize warning in "My filters"
Related feedback:
f1ce3b2191 (commitcomment-130633291)
2023-10-22 17:52:38 -04:00
Raymond Hill
f1ce3b2191
Add warning against adding custom filters from untrusted sources
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2895#discussioncomment-7351138
2023-10-22 10:47:52 -04:00
Raymond Hill
e15951dce5
Convert remaining vAPI.setTimeout to vAPI.defer
Related commit:
- 91f9795023
2023-04-14 10:26:45 -04:00
Raymond Hill
bc21a1fe72
Use custom linter gutter as container for code-folding widgets
This allows to reduce the horizontal size of the gutter; more efficient
management of folding since we already need to parse each line for the
linter; and eventually this will also allows to detect unbalanced
!#if-!#endif directives and report such cases as errors.

Additionally, keep incrementally improving error reporting details
in the linter.
2023-04-06 13:14:42 -04:00
Raymond Hill
50afd5ae38
Add infrastructure for static filter syntax linter
Sort of related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134
2023-04-01 16:42:41 -04:00
Raymond Hill
a60a5c2772
Fix wrong syntax color highlight in "Trusted sites" pane
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2521
2023-03-02 20:50:32 -05:00
Raymond Hill
33c437f99f
Add source code viewer (from logger)
This commits add the ability to open html/css/script
resources from the logger, as a formatted and syntax-
highligthed document.

The goal is to make it easier for filter list authors to
investigate filter-related issues.
2023-03-01 11:04:40 -05:00
Raymond Hill
feaa338678
Code maintenance: replace uDom.js with dom.js
`uDom` is old and crusty and `dom` is meant as replacement. The
goal of `dom` is to be simpler and mainly just convenience
methods for handling the DOM with vanilla JS -- this is not a
framework.

Additionally, removed keyboard shortcuts pane which was useful
only on very old versions of Firefox.
2022-11-12 09:51:22 -05:00
Raymond Hill
e31637af78
[mv3] Add ability to enable/disable filter lists 2022-09-13 17:44:24 -04:00
Raymond Hill
ecb73d2ff5
Bring dark theme out of experimental status
Too many changes to list here, essentially there is now a
user interface setting to enable/disable dark theme, and
I've rearranged a bit the Settings pane as a result and
also altered other visuals in various places.

There are places which I know have not been thoroughly
tested (i.e. logger inspector).

Will fine-tune as per feedback.

Issues with the classic popup panel will not be addressed,
and if feedback is that it has become unusuable, it will be
outright removed.
2022-02-02 15:40:47 -05:00
Raymond Hill
4ee8a5948d
Work toward bringing dark theme closer to a stable release
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/401
2022-01-30 18:35:26 -05:00
Raymond Hill
22022f636f
Modularize codebase with export/import
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1664

The changes are enough to fulfill the related issue.

A new platform has been added in order to allow for building
a NodeJS package. From the root of the project:

    ./tools/make-nodejs

This will create new uBlock0.nodejs directory in the
./dist/build directory, which is a valid NodeJS package.

From the root of the package, you can try:

    node test

This will instantiate a static network filtering engine,
populated by easylist and easyprivacy, which can be used
to match network requests by filling the appropriate
filtering context object.

The test.js file contains code which is typical example
of usage of the package.

Limitations: the NodeJS package can't execute the WASM
versions of the code since the WASM module requires the
use of fetch(), which is not available in NodeJS.

This is a first pass at modularizing the codebase, and
while at it a number of opportunistic small rewrites
have also been made.

This commit requires the minimum supported version for
Chromium and Firefox be raised to 61 and 60 respectively.
2021-07-27 17:26:04 -04:00
Raymond Hill
e85c6f2d3e
Merge background changes to user filters in "My filters" pane
Related issue:
- https://github.com/gorhill/uBlock/issues/3704
2021-07-17 12:03:56 -04:00
Raymond Hill
426395aa03
Improve extraction of tokens from regex-based filters
Regex-based static network filters are those most likely to
cause performance degradation, and as such the best guard
against undue performance degradation caused by regex-based
filters is the ability to extract valid and good tokens
from regex patterns.

This commit introduces a complete regex parser so that the
static network filtering engine can now safely extract
tokens regardless of the complexity of the regex pattern.

The regex parser is a library imported from:
https://github.com/foo123/RegexAnalyzer

The syntax highlighter adds an underline to regex-based
filters as a visual aid to filter authors so as to avoid
mistakenly creating regex-based filters. This commit
further colors the underline as a warning when a regex-based
filter is found to be untokenizable.

Filter list authors are invited to spot these untokenizable
regex-based filters in their lists to verify that no
mistake were made for those filters, causing them to be
untokenizabke. For example, what appears to be a mistake:

    /^https?:\/\/.*\/sw.js?.[a-zA-Z0-9%]{50,}/

Though the mistake is minor, the regex-based filter above
is untokenizable as a result, and become tokenizable when
the `.` is properly escaped:

    /^https?:\/\/.*\/sw\.js?.[a-zA-Z0-9%]{50,}/

Filter list authors can use this search expression in the
asset viewer to find instances of regex-based filters:

    /^(@@)?\/[^\n]+\/(\$|$)/
2020-12-26 08:52:42 -05:00
Raymond Hill
e559cb73b9
Complete removal of font-based Fontawesome icons
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/249
2020-12-06 11:24:04 -05:00
Raymond Hill
fc0b5e4ef1
Link to the "My filters" wiki page
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1279#issuecomment-703700929
2020-10-05 11:38:30 -04:00
Raymond Hill
23332400f5
Improve annotations for search operations in CodeMirror editor
Before this commit, CodeMirror's add-on for search occurrences
was limited to find at most 1000 first occurrences, because of
performance considerations.

This commit removes this low limit by having the search
occurrences done in a dedicated worker. The limit is now
time-based, and highly unlikely to ever be hit under normal
condition.

With this change, all search occurrences are gathered,
and as a result:

- All occurrences are reported in the scrollbar instead of
just the 1,000 first

- The total count of all occurrences is now reported, instead
of capping at "1000+".

- The current occurrence rank at the cursor or selection
position is now reported -- this was not possible to report
this before.

The number of occurrences is line-based, it's not useful to
report finer-grained occurences in uBO.
2020-08-02 12:18:01 -04:00
Raymond Hill
e44a568278
Add CoreMirror's code-folding ability to list editor/viewer
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134

CodeMirror's code folding reference:
- https://codemirror.net/doc/manual.html#addon_foldcode

This commit adds support for code-folding to the filter
list editor/viewer.

The following blocks of code are foldable by clicking the
corresponding marker in the gutter:

- !#if/#endif blocks
- !#include blocks

Addtionally, the following changes:

- The `!#include` line is now preserved when importing a
  sublist
- The `!#if` directives will be syntax-colored according
  to whether they evaluate to true or false on the current
  platform
- Double-clicking on a foldable line in the gutter will
  select the content of the foldable block
- Minor visual improvement to matching brackets
2020-07-10 08:01:39 -04:00
Raymond Hill
83c01fb352
Add syntax highlighting/auto-completion for preparsing directives
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134

Invalid values for `!#if ...` will be highlighted as errors.

Auto completion is now supported for both the directives
themselves and the valid values for `!#if ...`.

For examples, when pressing ctrl-space:

- `!#e` will auto-complete to `!#endif`
- `!#i` will offer to choose between `!#if ` or `!#include `
- `!#if fir` will auto-complete to `!#if env_firefox`

Additionally, support for some of AdGuard preparsing
directives, i.e. `!#if adguard` is now a valid and will be
honoured -- it always evaluate to `false` in uBO.
2020-07-08 09:52:27 -04:00
Raymond Hill
3e72a47c1f
Add support for auto-completion in _My filters_ pane
This commit adds CodeMirror's auto-completion capability
to the _My filters_ pane.

Currently, auto-completion is available for scriptlet
tokens: pressing ctrl-space while the text cursor is
positioned where a scriptlet token should appear will
cause auto-completion to kick-in. In case of ambiguity,
CodeMirror's widget to pick a specific scriptlet will
appear.
2020-06-15 09:15:13 -04:00
Raymond Hill
0e32e4391d
Add ability to comment out block of filters
Pressing Tab in _My filters_ will toggle the
commenting out of filters in the current
selection or current line if no selection.
2020-06-14 14:02:33 -04:00
Raymond Hill
6d8b310d94
Minor code review of static filtering parser
Rename `l` property to `len`, to avoid ambiguity as
`l` could mean _left_ or _length_. Typically `l` is
to be used for _left_ (whereas `r` is to be used for
_right_).

Additionally, add CodeMirror's bracket-matching and
bracket auto-closing to _My filters_ pane and and
bracket-matching to asset viewer page.
2020-06-14 12:05:42 -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
fe94aa331a
Replace CodeMirror resize code with CSS flex 2020-04-25 10:19:08 -04:00
Raymond Hill
5bee33253f
More work toward redesigning the UI
As per email feedback from Mozilla's
https://github.com/brampitoyo

This is yet another incremental step toward
redesigning the UI, much more is left to do.
The idea is to align uBO's UI to that of
Firefox Preview.

Additionally, code has been added to reset
the new popup panel to vertical layout should
the viewport be not wide enough to
accomodate the horizontal layout.

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/g4ufvi/
2020-04-21 16:33:08 -04:00
Raymond Hill
54b68ebd94
Fine tune various visuals
Related feedback:
- e917213e81 (commitcomment-38533349)
2020-04-16 08:49:34 -04:00
Raymond Hill
0662767dd6
Fifth pass to re-design the dashboard
Related commits:
- 99b2a0a761
- a8e3118fea
- 453f5450b6
- a45a21f337

Fine tuned previous work.

Started the use of variable-based color values.
2020-04-11 11:32:43 -04:00
Raymond Hill
17886abcda
Centralize break-all CSS property
So that both asset viewer and "My filters" inherit
the property for filter list rendering.
2020-03-15 09:25:18 -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
fce2eaf3c3
further improving UI for small screens 2018-03-28 16:15:50 -04:00
Raymond Hill
f764435812
various changes to enhance UI for mobile devices 2018-03-28 09:11:55 -04:00
Raymond Hill
31eaa766dc
fix other quirks with rtl languages (#3611) 2018-03-16 19:38:43 -04:00
Raymond Hill
9df0202a00
[codemirror] add active line addon 2018-03-05 06:59:03 -05:00
Raymond Hill
d6b733010d
add missing stylesheet (#3567) 2018-03-04 15:00:00 -05:00
Raymond Hill
bc61bef9a7
address #3567 2018-03-04 14:07:01 -05:00
Raymond Hill
61ec088d43
integrate codemirror into "My filters" pane 2018-02-28 18:51:33 -05:00
gorhill
bbda2a9086
code review: preemptively address https://bugzilla.mozilla.org/show_bug.cgi?id=1408996#c9 2017-10-27 14:22:45 -04:00
gorhill
fb37378e7c
Revert "Tabnapping prevention (#2529)". Reason: breaks links in dashboard on Firefox.
This reverts commit 557f378bf8.
2017-04-29 10:08:20 -04:00
timse201
557f378bf8 Tabnapping prevention (#2529)
* tabnapping prevention

* Tabnapping prevention

* Tabnapping prevention

* Tabnapping prevention

* Tabnapping prevention
2017-04-26 12:40:41 -04:00
gorhill
1a075bc673 code review: mobile-friendly changes 2017-01-24 08:23:52 -05:00
gorhill
371670802b this fixes #695 2015-10-03 10:28:53 -04:00
gorhill
f338c28cd6 support append from cloud storage + uniformize buttons visual in dashboard 2015-08-12 12:17:39 -04:00
gorhill
690421aead sync feature (#80): draft 2015-08-11 15:29:14 -04:00
gorhill
50f047eb45 this fixes #250 2015-05-28 16:26:01 -04:00
Chris
30eafed70a More µ to u 2015-03-09 22:00:48 -06:00