1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-18 08:52:26 +02:00
Commit Graph

565 Commits

Author SHA1 Message Date
Raymond Hill
e110cce92a
Fine tune rule colors
Use explicit color values, as alpha-merging does not guarantee
uniform lightness.
2022-01-31 09:10:20 -05:00
Raymond Hill
819279d99d
More fine-tuning following CSS changes 2022-01-30 20:13:31 -05:00
Raymond Hill
f8c6be868c
Fine tune lightness (Luv) of rule colors in light theme
Trying to use same Luv for both light and dark theme does not
really work -- best to have each them have their own Luv for
rule colors.
2022-01-30 19:39:18 -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
b565d311a4
Fix CSS sizing of click-to-load widget as suggested
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1901
2022-01-07 08:02:31 -05:00
Raymond Hill
a86e804c9c
Assign min width to the button
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1886
2021-12-19 08:13:43 -05:00
Raymond Hill
4d482f9133
Store regex filter pattern into bidi-trie buffer
As was done with generic pattern-based filters, the source
string of regex-based filters is now stored into the
bidi-trie (pattern) buffer.

Additionally, added a new "dev tools" page to more
conveniently peer into uBO's internals at run time, without
having to do so from the browser's dev console -- something
which has become more difficult with the use of JS modules.

The new page can be launched from the Support pane through
the "More" button in the troubleshooting section.

The benchmark button in the About pane has been moved to this
new "dev tools" page.

The new "dev tools" page is for development purpose only,
do not open issues about it.
2021-12-12 10:32:49 -05:00
Raymond Hill
6ebebbe23c
Adjust color of cloud storage widget for datk theme
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1867
2021-12-10 07:52:52 -05:00
Raymond Hill
aad90eb323
More fine tuning of filter issue report feature 2021-11-28 07:47:16 -05:00
Raymond Hill
1408422cba
Fine tune new reporting feature
Add ability to bring back logger button in popup panel through
the advanced setting `uiPopupConfig`. Adding `+logger` token
to `uiPopupConfig` will bring back the logger icon in the mobile
version of the popup panel.

Additionally, the link to the logger in the Support pane will
take into account whether the <Shift> key is pressed, so as
to behave like the logger icon in the popup panel.

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

The troubleshooting information has been further fine-tuned to
report popup panel data related to the reported page, for better
diagnosis by disclosing any customization to uBO which was
affecting the reported page.
2021-11-27 11:58:32 -05:00
Raymond Hill
74d1f90264
Allow reporter to select a choice of URLs to report
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1836

The URL to report can now be picked from a list of related
URLs in order to allow the reporter to publish edited version
of the reported URL.

Additionally, the hash, user name, and password which could be
present in a reported URL are always removed.
2021-11-26 12:23:18 -05:00
Raymond Hill
064ffe4cc7
Remove usage of CSS zoom
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1793
2021-11-13 11:05:35 -05:00
Raymond Hill
eccf613edf
Add ability to report filter issue from popup panel
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541

A "chat" icon has been added to the popup panel to make
it easy to report filter issue on specific sites.

Reporting filter issues require a GitHub account, since
uBO does not have a home server through which reports could
be sent.

The report icon is available only for when uBO is enabled
on a given site.

On mobile devices, the logger icon is replaced by the "chat"
icon since it is more likely to be useful on small display
devices. The logger can always be opened from the Support
pane in the dashboard.
2021-11-11 12:49:55 -05:00
Raymond Hill
c2269d7202
Minor CSS fix 2021-10-18 09:11:34 -04:00
Raymond Hill
a72aa58c92
Adjust font-size for code tags 2021-10-17 13:47:41 -04:00
Raymond Hill
730735cc5e
Further fine-tune new Support pane
Related commit:
- a3a43c7cb4

Specifically:
- Support i18n
- Autofill issues opened through Support pane with configuration
  information
- Remove from About pane items found in Support pane
2021-10-15 14:50:34 -04:00
Raymond Hill
f9989f30d8
Further improve new Support pane
For now the language locales are not available as the text on
the page needs to stabilize before asking translation
volunteers to contribute their time working on the new text.
2021-10-13 11:18:23 -04:00
Raymond Hill
e7444883a3
Fine tune data reported in Support pane
Related commit:
- a3a43c7cb4
2021-10-13 08:31:04 -04:00
Raymond Hill
a3a43c7cb4
Add "Support" pane to dashboard
The purpose is to allow users to make it easy to share
technical information about their uBO configuration, and
to make it easy for volunteers to diagnose issues.

This is a first step toward the goal of making it easier
for users to report issues with either uBO or filter
issues on websites.

Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1701
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541
2021-10-12 11:19:56 -04:00
Raymond Hill
68dfe98045
Add visual hint to grab area of element picker dialog
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1714
2021-09-12 10:47:40 -04:00
Raymond Hill
cfa00797ed
Add spacer at the bottom of popup panel in portrait mode
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1604
- https://github.com/uBlockOrigin/uBlock-issues/issues/1691
2021-08-22 10:20:31 -04:00
Raymond Hill
75deadd31e
Provide visual cue in popup panel when base domain has subdomains
Related issue:
- https://github.com/gorhill/uBlock/issues/284
2021-07-20 08:37:05 -04:00
Raymond Hill
7508700892
Prevent unchecked default lists from being visually collapsed
Related issue:
- https://github.com/gorhill/uBlock/issues/2303
2021-05-19 09:34:46 -04:00
Raymond Hill
49f2c0d756
Bring back experimental widget for current dev cycle 2021-03-13 09:08:19 -05:00
Raymond Hill
f876b68171
Add support for removal of response headers
The syntax to remove response header is a special case
of HTML filtering, whereas the response headers are
targeted, rather than the response body:

  example.com##^responseheader(header-name)

Where `header-name` is the name of the header to
remove, and must always be lowercase.

The removal of response headers can only be applied to
document resources, i.e. main- or sub-frames.

Only a limited set of headers can be targeted for
removal:

  location
  refresh
  report-to
  set-cookie

This limitation is to ensure that uBO never lowers the
security profile of web pages, i.e. we wouldn't want to
remove `content-security-policy`.

Given that the header removal occurs at onHeaderReceived
time, this new ability works for all browsers.

The motivation for this new filtering ability is instance
of website using a `refresh` header to redirect a visitor
to an undesirable destination after a few seconds.
2021-03-13 08:53:34 -05:00
Raymond Hill
af980c5c06
Disable unfinished widget from stable release 2021-03-10 08:17:31 -05:00
Raymond Hill
1c3b45f75d
Expose ability to toggle on/off cname-uncloaking to all users
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1513

Prior to this commit, the ability to enable/disable the
uncloaking of canonical names was only available to advanced
users. This commit make it so that the setting can be
toggled from the _Settings_ pane.

The setting is enabled by default. The documentation should
be clear that the setting should not be disabled unless it
actually solves serious network issues, for example:

https://bugzilla.mozilla.org/show_bug.cgi?id=1694404

Also, as a result, the advanced setting `cnameUncloak` is no
longer available from within the advanced settings editor.
2021-03-02 13:00:56 -05:00
Raymond Hill
435c91636f
Count allowed/blocked requests for 3rd-party scripts/frames
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/210

Additionally, a small (experimental) widget has been added
to emphasize/de-emphasize rows which have 3rd-party
scripts/frames, so as to more easily identify which rows
are "affected" by 3rd-party scripts and/or frames.

Tooltip localization for the new widget is not available
yet as I want wait for the feature to be fully settled.
2021-02-15 06:52:31 -05:00
Raymond Hill
cc9c45f1e4
Adding to and further reviewing admin-managed settings 2021-01-06 11:39:24 -05:00
Raymond Hill
c1130ec843
Add support for admin-managed hidden settings
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1437#issuecomment-754127066
2021-01-05 12:16:50 -05:00
Raymond Hill
780b605bad
Fix missing magnifier in document-blocked page
Related feedback:
- e559cb73b9 (commitcomment-44887972)

Regression from:
- e559cb73b9
2020-12-07 14:32:59 -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
db7f54dbf6
Add support to launch element picker in embedded frames
Related issue:
- https://github.com/gorhill/uBlock/issues/1744

A new context menu entry, "Block element in frame...", will
be present when right-clicking on a frame element. When
this entry is clicked, uBO's element picker will be
launched from within the embedded frame and function the
same way as when launched from within the page.
2020-12-05 15:26:29 -05:00
Raymond Hill
bde3164eb4
Add support for 1P, 3P, header= filter options and other changes
New filter options
==================

Strict partyness: `1P`, `3P`
----------------------------

The current options 1p/3p are meant to "weakly" match partyness, i.e. a
network request is considered 1st-party to its context as long as both the
context and the request share the same base domain.

The new partyness options are meant to check for strict partyness, i.e. a
network request will be considered 1st-party if and only if both the context
and the request share the same hostname.

For examples:

- context: `www.example.org`
- request: `www.example.org`
- `1p`: yes, `1P`: yes
- `3p`: no,  `3P`: no

- context: `www.example.org`
- request: `subdomain.example.org`
- `1p`: yes, `1P`: no
- `3p`: no,  `3P`: yes

- context: `www.example.org`
- request: `www.example.com`
- `1p`: no, `1P`: no
- `3p`: yes,  `3P`: yes

The strict partyness options will be visually emphasized in the editor so as
to prevent mistakenly using `1P` or `3P` where weak partyness is meant to be
used.

Filter on response headers: `header=`
-------------------------------------

Currently experimental and under evaluation. Disabled by default, enable by
toggling `filterOnHeaders` to `true` in advanced settings.

Ability to filter network requests according to whether a specific response
header is present and whether it matches or does not match a specific value.

For example:

    *$1p,3P,script,header=via:1\.1\s+google

The above filter is meant to block network requests which fullfill all the
following conditions:

- is weakly 1st-party to the context
- is not strictly 1st-party to the context
- is of type `script`
- has a response HTTP header named `via`, which value matches the regular
  expression `1\.1\s+google`.

The matches are always performed in a case-insensitive manner.

The header value is assumed to be a literal regular expression, except for
the following special characters:

- to anchor to start of string, use leading `|`, not `^`
- to anchor to end of string, use trailing `|`, not `$`
- to invert the test, use a leading `!`

To block a network request if it merely contains a specific HTTP header is
just a matter of specifying the header name without a header value:

    *$1p,3P,script,header=via

Generic exception filters can be used to disable specific block `header=`
filters, i.e. `@@*$1p,3P,script,header` will override the block `header=`
filters given as example above.

Dynamic filtering's `allow` rules override block `headers=` filters.

Important: It is key that filter authors use as many narrowing filter options
as possible when using the `header=` option, and the `header=` option should
be used ONLY when other filter options are not sufficient.

More documentation justifying the purpose of `header=` option will be
provided eventually if ever it is decided to move it from experimental to
stable status.

To be decided: to restrict usage of this filter option to only uBO's own
filter lists or "My filters".

Changes
=======

Fine tuning `queryprune=`
-------------------------

The following changes have been implemented:

The special value `*` (i.e. `queryprune=*`) means "remove all query
parameters".

If the `queryprune=` value is made only of alphanumeric characters
(including `_`), the value will be internally converted to regex  equivalent
`^value=`. This ensures a better future compatibility with AdGuard's
`removeparam=`.

If the `queryprune=` value starts with `!`, the test will be inverted. This
can be used to remove all query parameters EXCEPT those who match the
specified value.

Other
-----

The legacy code to test for spurious CSP reports has been removed. This
is no longer an issue ever since uBO redirects to local resources through
web accessible resources.

Notes
=====

The following new and recently added filter options are not compatible with
Chromium's manifest v3 changes:

- `queryprune=`
- `1P`
- `3P`
- `header=`
2020-11-23 08:22:43 -05:00
Raymond Hill
4b943cf07f
Fix scrollbar not receiving mouse event in element picker
Not sure why I set z-index to 0; removed due to mouse
event not reaching the scrollbar.
2020-11-20 11:37:00 -05:00
Raymond Hill
13f6bdae37
Improve representation of modifier filters in logger
As per feedback from filter list maintainers.
2020-11-20 07:14:02 -05:00
Raymond Hill
8362751be5
Allow to scroll for URL in click-to-load
Some URLs can be quite long, so the div containing
the URL needs to be scrollable if needed.
2020-11-14 11:59:06 -05:00
Raymond Hill
46d7f8a70c
Fine tune click-to-load widget
Notably, add clickable link to open the widget
in its own tab. Also, allows the URL to be text-
selected so that it becomes possible to use the
selection in a browser contextual menu's "Open
in a new tab" option.
2020-11-14 08:34:47 -05:00
Raymond Hill
13d1f9ede5
Drop CSS styles already define in common.css 2020-11-06 12:26:12 -05:00
Raymond Hill
1ef1e02b86
Fine tune CodeMirror search highlight rendering 2020-11-05 06:04:37 -05:00
Raymond Hill
4059a92838
Fine tune built-in benchmark
Additionally, add a button in the About pane
to launch benchmark sessions. The button will
be available only when advanced setting
`benchmarkDatasetURL` is set and pointing to
a valid dataset.
2020-10-27 12:59:31 -04:00
Raymond Hill
516696a60c
Increase search style priority in CodeMirror editors 2020-10-24 08:26:38 -04:00
Raymond Hill
b75758808e
Ensure the bottom of dashboard panes is visible
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1304

On small displays, not being able to scroll down
could become a usability issue.
2020-10-21 12:50:24 -04:00
Raymond Hill
ee059540f7
Cache element picker's optimized candidates for reuse
Optimized candidates computed for each depth are now
cached for reuse. This reduces the amount of work
done when moving the depth slider.
2020-10-20 05:37:07 -04:00
Raymond Hill
e47f3c48aa
Minor fine tuning of CSS 2020-10-19 08:00:38 -04:00
Raymond Hill
9947fcf4d5
Improve layout of popup panel when rendered in a tab
This brings back the ability to screenshot the whole
list of domains when the popup panel is opened in a
tab.
2020-10-18 10:00:55 -04:00
Raymond Hill
a095b83250
Use a CodeMirror editor instance in element picker
This allows to bring in all the benefits of
syntax highlighting and enhanced editing
features in the element picker, like auto-
completion, etc.

This is also a necessary step to possibly solve
the following issue:

- https://github.com/gorhill/uBlock/issues/2035

Additionally, incrementally improved the behavior
of uBO's custom CodeMirror static filtering syntax
mode when double-clicking somewhere in a static
extended filter:

- on a class/id string will cause the whole
  class/id string to be   selected, including the
  prepending `.`/`#`.

- somewhere in a hostname/entity will cause all
  the labels from the cursor position to the
  right-most label to be selected (subject to
  change/fine-tune as per feedback of filter
  list maintainers).

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134#issuecomment-679421316
2020-10-14 10:21:30 -04:00
Raymond Hill
376ef4645f
Fine tune click-to-load visual 2020-10-11 07:45:16 -04:00
Raymond Hill
2e5d32e967
Fine tune code related to click-to-load feature
The redirectable resource has been renamed
`click2load.html`, so as to avoid uses of dash
characters and to also allow for future different
click-to-load resources.
2020-10-10 08:36:30 -04:00
Raymond Hill
5916920985
Add support for click-to-load of embedded frames
Additionally, as a requirement to support click-to-load
feature, redirected resources will from now on no
longer be collapsed.

Related issues:
- https://github.com/gorhill/uBlock/issues/2688
- https://github.com/gorhill/uBlock/issues/3619
- https://github.com/gorhill/uBlock/issues/1899

This new feature should considered in its draft
stage and it needs to be fine-tuned as per
feedback.

Important: Only embedded frames can be converted
into click-to-load widgets, as only these can be
properly shieded from access by page content.

Examples of usage:

    ||youtube.com/embed/$3p,frame,redirect=clicktoload
    ||scribd.com/embeds/$3p,frame,redirect=clicktoload
    ||player.vimeo.com/video/$3p,frame,redirect=clicktoload
2020-10-09 13:50:54 -04:00
Raymond Hill
bfe5e2daa1
Limit width of picker dialog in large viewport 2020-10-07 11:04:16 -04:00
Raymond Hill
778338fce8
Fix picker generating overly long candidate cosmetic filters
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/j5tx8x/understand_the_element_blocker_and_feedback/g7wf2q9/

Regression from:
- https://github.com/gorhill/uBlock/commit/9eb455ab5eb2
2020-10-06 17:26:28 -04:00
Raymond Hill
e3a6d8465f
Add advanced setting to force a light/dark theme
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/401#issuecomment-703075797

Name: `uiTheme`
Default: `unset`
Values:
- `unset`: uBO will pick the theme according to
  browser's `prefers-color-scheme`
- `light`: force light scheme
- `dark`: force dark theme

This advanced setting is not to be documented yet as
it has not been decided this is a long term solution.
2020-10-03 07:13:40 -04:00
Raymond Hill
b179dc0268
Add more CSS variables for theming
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/401
2020-10-03 06:00:48 -04:00
Raymond Hill
266a170beb
Add more CSS variables in preparation of dark mode support
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/401
2020-10-02 12:18:13 -04:00
Raymond Hill
303240c713
Minor changes to dark theme
A whole lot more work needed across all of uBO's user
interface.
2020-10-01 10:09:59 -04:00
jeremyperkin
fba5f3d597
Update default.css
- Added values for dark mode
- Using the photon colors and reviewing material design - Put this together.
- Correct fieldset-header-ink
- Removed color variables already listed.
- Removal of !important and revert to some already approved colours.

Signed-off-by: Raymond Hill <rhill@raymondhill.net>
2020-09-30 12:34:52 -04:00
Raymond Hill
fef375a594
Minor improvements to syntax highlight of static filters
Double-cliking on a URL will cause the whole URL to be
selected, thus making it easier to navigate to this
URL (through your browser "Open in new tab" entry in
contextual menu).

Unrecognized scriptlet names will be highlighted so as
to warn that the filter is not going to be effective.
2020-09-30 10:01:10 -04:00
Raymond Hill
1cdffea618
Allow customization of some popup panel CSS properties
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1254

The advanced setting `uiStyles`[1] can be used to control
the minimum width of both the main and firewall panes
in the popup panel:

- `--popup-main-min-width`, default to `18em`
- `--popup-firewall-min-width`, default to `30em`

* * *

[1] https://github.com/gorhill/uBlock/wiki/Advanced-settings#uistyles
2020-09-21 07:18:11 -04:00
Raymond Hill
7ed543db0d
Fine tune visual of slider widgets in element picker
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/851
2020-09-16 07:01:16 -04:00
Raymond Hill
e60042595c
Revisit the behavior of the click-to-subscribe content script
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/763

Changes:

From now on, uBO will allow click-to-subscribe on only
a few select domains, currently:
- https://filterlists.com/
- https://github.com/
- https://github.io/

More domains can be added if and only the demonstration
is made that more than a marginal number of filter lists
can be subscribed from those domains.

The browser alert box is no longer used to confirm
subscription to a filter list. Instead, the asset
viewer has been expanded to serve that purpose. This
way, users can peruse at the content of a filter list
before subscribing to it.
2020-09-13 08:01:53 -04:00
Raymond Hill
b73b24ebb1
Fix slider's responsiveness to layout changes
Related commit:
- f01bda1159
2020-09-12 08:26:44 -04:00
Raymond Hill
f01bda1159
Rework visuals of element picker sliders
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/851
2020-09-12 07:28:46 -04:00
Raymond Hill
260f762c83
Add widget to control selector depth to element picker
Further iterating on the work done in following commit:
- 1268f0ae43

This commit adds a new widget to the element picker to
control the depth of a cosmetic filter selector. The
new widget is essentially just another way of selecting
the depth, which is still controllable through picking
one of the cosmetic filters in the list of candidates.
2020-09-10 10:32:53 -04:00
Raymond Hill
1268f0ae43
Add element picker widget to control specificity
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/851

The ctrl key is no longer used to adjust specificity of
a candidate filter.

A new widget has been added to adjust the specificity of
a candidate filter to various level. The widget will be
visible as long as the candidate filter matches one entry
in the list of suggested candidate cosmetic filters.
2020-09-09 09:27:53 -04:00
Raymond Hill
d23f9c6a8b
Isolate element picker's svg layers from page content
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1226

Related commit:
- 9eb455ab5e

In the previous commit, the element picker dialog was
isolated from the page content. This commit is to also
isolate the svg layers from the page content.

With this commit, there is no longer a need for an anonymous
iframe and the isolated world iframe is now directly
embedded in the page.

As a result, pages are now unable to interfere with any
of the element picker user interface. Pages can now only
see an iframe, but are unable to see the content of that
iframe. The styles applied to the iframe are from a user
stylesheet, so as to ensure pages can't override the
iframe's style properties set by uBO.
2020-09-03 10:27:35 -04:00
Raymond Hill
9eb455ab5e
Isolate element picker dialog from page content world
Related issues:
- https://github.com/gorhill/uBlock/issues/3497
- https://github.com/uBlockOrigin/uBlock-issues/issues/1215

To solve above issues, the element picker's dialog is now
isolated from the page content in which it is embedded.

The highly interactive, mouse-driven part of the element
picker is still visible by the page content.
2020-09-01 12:32:12 -04:00
Raymond Hill
3bbed7be33
Do not use letter-spacing for non-bolded text
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1044#issuecomment-682920219
2020-08-29 08:32:40 -04:00
Raymond Hill
51ab3e6c52
Fix misaligned label 2020-08-25 13:46:36 -04:00
Raymond Hill
532ed5c390
Add ability to collpase unchanged rules in _My rules_ pane
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/604
2020-08-25 13:23:30 -04:00
Raymond Hill
dd655473f6
Add ability to sort rules in _My rules_ pane
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1055
2020-08-24 12:39:07 -04:00
Raymond Hill
db79672355
Fix layout issue with cloud storage widget
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1217
2020-08-21 08:57:47 -04:00
Raymond Hill
394a61570c
Use modern popup panel in logger
The logger was still embedding the now deprecated popup
panel.
2020-08-21 08:23:36 -04:00
Raymond Hill
2afcc13ca6
Add widget to convey the amount of sync storage in use 2020-08-14 15:29:25 -04:00
Raymond Hill
b01cc6ca4f
Fix cloud storage errors not reported in user interface
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/i6e7lr/
2020-08-10 08:30:52 -04:00
Raymond Hill
e44af458c0
Fine tune visuals of CodeMirror's search feature
Added a dotted box around found text occurrences,
as just pale yellow to highlight the text is not
enough to visually distinguish from surrounding text.

Iterating through found text occurrences will now
ensure they are vertically positioned in the middle
of the editor.
2020-08-04 10:14:38 -04:00
Raymond Hill
59496cfa45
Restore visual of input field on Firefox 2020-08-03 14:30:30 -04:00
Raymond Hill
50bf999a12
Fine tune CodeMirror editor's search widget
Code review following latest changes.

Also, move the input field to the left so that it
renders properly on smaller displays and does not
jump around when the result position/count numbers
change.

This also makes it easier to add more functionality
to the editor's toolbar in the future.
2020-08-03 08:55:02 -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
9880b9c18f
Fix too small magnifier
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1092

As a result of earlier redesign, the magnifier ended
up being too small. The size of the magnifier will now
be dependent on the default font size instead of the
parent font size.
2020-07-18 09:50:59 -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
aa000e282e
Add auto-completion for procedural operators
Related commit:
- 3e72a47c1f
2020-06-16 08:59:55 -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
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
08eca13364
Visually emphasize regex-based pattern
To help prevent mistakenly creating regex-based
patterns.
2020-06-08 12:39:31 -04:00
Raymond Hill
2ba4312a8b
Minor fine-tuning of CSS color 2020-06-05 10:00:35 -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
162e537270
Make the creation of _allow_ rules in panel an opt-in feature
There have been too many examples out there of users
opting-in to "I am an advanced user" and yet still misusing
dynamic filtering by creating _allow_ rules where _noop_
rules should be used.

Creating _allow_ rules has serious consequences as these
override blocking static filters and can potentially
disable other advanced filtering ability such as
HTML filtering and scriptlet injection -- often used
to deal with anti-blocker mechanisms.

The ability to point-and-click to create _allow_ rules
from the popup panel is no longer allowed by default.

An new advanced setting has been added to enable
the ability to create _allow_ rules from the popup
panel, `popupPanelGodMode`, which default to `false`.
Set to `true` to restore ability to set _allow_ rules
from popup panel.

Since the creation of _allow_ rules is especially useful
to filter list authors, to diagnose and narrow down site
breakage as a result of problematic blocking filter,
the creation of _allow_ rules will still be available
when the advanced setting `filterAuthorMode` is `true`.

This change is probably going to be problematic to all
those users who were misusing dynamic filtering by
creating _allow_ rules instead of _noop_ rules -- but
the breakage is going to bring their misusing to their
attention, a positive outcome.
2020-05-22 11:35:44 -04:00
Raymond Hill
5f4e6d80e0
Add ability to lock firewall height to basic pane height
New advanced setting: `popupPanelHeightMode`.
Default value: 0

Set to 1 to force the height of the firewall pane
to be no more than the height of the basic pane.

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/785#issuecomment-622327450
2020-05-22 08:47:51 -04:00
Raymond Hill
9f7e5b621d
Add new advanced setting: uiStyles
Default to `unset`.

To allow users to bypass uBO's default CSS styles in
case they are causing issues to specific users. It is
the responsibility of the user to ensure the value of
`uiStyles` contains valid CSS property declarations.
uBO will assign the value to `document.body.style.cssText`.

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

For example, in the case of the issue above, one could
set `uiStyles` to `font-family: sans-serif` to force uBO
to the system font for its user interface.
2020-05-19 10:33:36 -04:00
Raymond Hill
e9f9b5f622
Remove unused CSS file 2020-05-19 10:28:40 -04:00
Raymond Hill
458f364e3e
Prevent more/less buttons from wrapping
The text of the more/less buttons was spotted
as wrapping in ja locale.
2020-05-18 09:08:11 -04:00
Raymond Hill
cb2ce0676b
More fine tuning of desktop panel as per feedback
Reduce height of more/less button. Related feedback:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-629867784

Use more concise text string for blocked requests
statistics. Related feedback:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-630015625

Fix issue with overly long hostnames, and spurious
spacing when using undocumented advanced setting.
Related feedback:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-630104078
2020-05-18 08:09:26 -04:00
Raymond Hill
2a1572982b
Remove stray extra top/bottom thin gap in tool icons
I can't remember the reason for the added thin gap,
there is no benefit from this for the desktop panel,
probably stray CSS code from some earlier fiddlings.
2020-05-17 17:35:01 -04:00
Raymond Hill
ddc03154d7
Fix inconsistent spacing in panel's statistics section 2020-05-17 12:30:04 -04:00
Raymond Hill
2237d97466
Even more fine tuning of UI as per feedback
Fix unstyled checkbox in "Filter lists" pane.
Related feedback:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-629780098

Hopefully fix glitchy popup panel when opened
from the extension icon. By default the panel is
configured to be rendered in landscape. It will be
toggled programmatically to portrait mode when
either the environment is mobile or the viewport
is horizontally constrained. Related feedback:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-629712393

New layout for rendering the statistics text
strings in landscape mode, so as to avoid text
wrapping and to allow a slightly narrower basic
pane. Related discussion:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-629785966
2020-05-17 08:49:37 -04:00
Raymond Hill
5c7aa850dc
More fine tuning of new UI as per feedback
Position the backup/restore/reset buttons at the
bottom in Settings pane. Related feedback:

https://github.com/gorhill/uBlock/commit/5bee33253f45#commitcomment-39221329

Use a fixed with for the fireall pane. Related
feedback:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-629668065

Fall back to a polyfill compact notation when
rednering large numbers in popup panel when the
required Intl.NumberFormat API is not fully
supported, at the expense of not being i18n-
compliant. Related discussion:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-629696676
2020-05-16 17:51:01 -04:00
Raymond Hill
ed49b42959
Minor fine tuning of CSS in new popup panel
Hopefully these will address some of the glitches
mentioned in the feedback comments:

https://github.com/uBlockOrigin/uBlock-issues/issues/1027#issuecomment-629636210
2020-05-16 09:30:48 -04:00
Raymond Hill
8859d4352f
Restore ability to set popup panel font size in advanced settings
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/397

Issue above will require non-trivial changes, so for
now users who prefer smaller/larger popup panel can
fall back on advanced setting `popupFontSize`:

https://github.com/gorhill/uBlock/wiki/Advanced-settings#popupfontsize
2020-05-16 07:36:03 -04:00
Raymond Hill
1a766530d3
Remove the use of CSS max
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1035

It's not supported on
- Chromium 78 and older
- Firefox 74 and older

Reference:
- https://developer.mozilla.org/en-US/docs/Web/CSS/max
2020-05-15 20:55:40 -04:00
Raymond Hill
6fea9f9e5c
Minor fine tuning new panel
The "blocked since install" row has been moved
in last position, so that figures that represent
the current site are grouped together.

Do not prevent wrapping the count text strings,
use a minimum width instead -- those count text
strings can be more verbose in some locale, and
by allowing the text to wrap this result in a
less wide main panel.
2020-05-15 19:16:54 -04:00
Raymond Hill
0d5f8e8fb2
Use fixed width for ruleset tools containers
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1033
2020-05-15 15:31:04 -04:00
Raymond Hill
2ded039b98
Increase min-width of #main pane in popu panel
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/gjyt4a/ubo_redesigned/fqps9ad/

As per feedback, Firefox is not causing large numbers
to be rendered in a compact form with German locale.

In Chromium, the number 40712345 renders as "40,71 Mio."
for the German locale, while in Firefox the same renders
as "40.710.000".
2020-05-15 11:49:48 -04:00
Raymond Hill
edc55034d7
Add missing ;
Related feedback:
- https://github.com/gorhill/uBlock/commit/e917213e81d4#commitcomment-39192290
2020-05-15 09:39:48 -04:00
Raymond Hill
8eab156901
Don't block on default Inter font loading 2020-05-11 17:50:53 -04:00
Raymond Hill
b94b2834d7
Fire tune CSS in new popup panel 2020-05-10 07:39:59 -04:00
Raymond Hill
d8bf72a435
Minor fine-tuning of visual of select elements
Additionally, have the width of the page selector
in the logger proportional to the width of the
logger -- this should improve usability on small
screen devices.
2020-05-08 06:38:23 -04:00
Raymond Hill
1a4e7a33b7
Simplify max-width rule of popup panel
Maybe it will help avoid the spurious
fall-into-vertical-layout issue. Maybe not.
2020-05-06 18:38:05 -04:00
Raymond Hill
104a1af6c2
Opacity transition probably not needed after all
Originally the idea was to hide from view the
popup panel layout seemingly being recalculated
by the browser at open time, causing visuals in
the popup panel to slightly move around. Possibly
no longer an issue now that the popup panel
initialization code has been modified since then
to use animation frames.
2020-05-06 11:24:07 -04:00
Raymond Hill
65d9e3f820
Shorten transition duration 2020-05-06 11:19:45 -04:00
Raymond Hill
563ba9136c
Improve heuristic to toggle panel to vertical layout
By using a larger tolerance.

Also, ensure that the hover visuals are still
being used in vertical layout mode on non-mobile
devices.
2020-05-06 10:39:03 -04:00
Raymond Hill
40b0d3a6b4
Minor visual adjustment in "Filter lists" pane 2020-05-05 14:35:38 -04:00
Raymond Hill
374901f605
Merge in some changes from dark branch 2020-05-05 10:03:11 -04:00
Raymond Hill
b69d802f17
Override font size of select on desktop
Regression, related commit:
- c7d196d472
2020-05-04 14:08:03 -04:00
Raymond Hill
56ac0bdd68
Minor fine tuning of popup panel visual
Specifically:
- Comply with Firefox iconography's size: multiple
  of 16px

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1005
2020-05-04 12:50:44 -04:00
Raymond Hill
c7d196d472
Re-design document-blocked page as per feedback
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1005

There is probably more work to do regarding the
shown URL -- it might be better to truncate it
on small screen display since it can be quite
long sometimes.
2020-05-04 12:41:10 -04:00
Raymond Hill
42dedfbd90
Fine tune power button; fix no-popups switch visual regression 2020-05-02 18:27:53 -04:00
Raymond Hill
38cdb42348
Allow hiding blocked count since install in popup panel
Also, more fine tuning of visuals.

Two new advanced settings, to be left undocumented as
"purposefully undocumented setting".
2020-05-01 19:47:01 -04:00
Raymond Hill
435c888c67
Add gap between power and ruleset buttons 2020-05-01 07:43:11 -04:00
Raymond Hill
2a5dfc20e1
Fine tune CSS of new popup panel 2020-05-01 07:30:22 -04:00
Raymond Hill
1a0cded43f
Make popup panel more/less buttons easier to click 2020-04-30 09:32:32 -04:00
Raymond Hill
b295d4a0d0
Make the new "fenix" popup panel the default one
The old "classic" popup panel will still be used
when at least one of the following is true:

- advanced setting `uiFlavor` is set to `classic`; or
- the browser is Chromium 65 or older; or
- the browser is Firefox 67 or older

The default configuration of the new popup panel
at installation time is to show the power button,
statistics and the basic tool icons, i.e. access
to dashboard, logger, pickers.

For existing installations, the new popup panel
will be configured by respecting the existing
configuration of the classic one.

The new popup panel is currently already in use
on Firefox for Android, and the visual redesign
was made according to suggestions and feedback
from <https://github.com/brampitoyo> to be
optimal for Firefox for Android.

The new popup panel will allow closing the following
pending issues:

- https://github.com/uBlockOrigin/uBlock-issues/issues/255
- https://github.com/uBlockOrigin/uBlock-issues/issues/178
2020-04-30 06:54:51 -04:00
Raymond Hill
3efee017cf
Fix own-rule text color
Related fedback:
- https://github.com/gorhill/uBlock/commit/db9c32185538#commitcomment-38818960
2020-04-29 06:16:59 -04:00
Raymond Hill
d364eb9668
Minor code review 2020-04-28 18:39:31 -04:00
Raymond Hill
9a6feb34d5
Re-order sections in the new popup panel
The blocking-stuff button icons have been brought
closer to the power button.

The go-somewhere button icons have been moved at
the bottom.

The hostname of the current site is now shown below
the power button. The base domain is bolded.

This re-ordering is for a few reasons:

- The blocking-stuff button icons are now closer
  to the revert/persist/reload transient buttons
  which show up when modifying the blocking
  behavior of uBO.

- The makes it easier to potentially bring in a
  very basic view where only the power button and
  the statistics are shown and all the button
  icons are hidden from view.
2020-04-27 19:01:16 -04:00
Raymond Hill
db9c321855
More work toward re-hauling the user interface
This commit specifically address bringing the
desktop version of the new popup panel's look
and feel more inline with the classic one:

- Hide tool captions on desktop

- Bring back no-popups switch on desktop

- Bring back tooltips on desktop (though they
  are now rendered natively by the browser)

- Use the Photon icons suggested by @brampitoyo
  for the no-popups and no-remote-fonts
  switches
2020-04-27 10:33:49 -04:00
Raymond Hill
43357e4a4d
Mind that checkbox can be in a flex container 2020-04-26 09:02:30 -04:00
Raymond Hill
8ed60af0f9
Fine tune material design-based checkbox code
Summary:
- Make checkbox nodes self-contained
  (a > b) instead of (a + b)
- Revisit logger to use new checkboxes
2020-04-26 08:44:00 -04:00
Raymond Hill
fefc7e21b2
Unbreaking checkbox in logger settings
Related commit:
- f9b385ffb1

The real fix is not trivial, so this is a workaround
until the real fix. The logger's setting dialog is
also suffering from small visual issues due to all
the CSS changes elsewhere recently, this will be fixed
at the same time.
2020-04-25 18:57:36 -04:00
Raymond Hill
f9b385ffb1
Standardize checkbox visual to material design
Motivation:
- To align with Firefox Preview's own design
- To uniformize checkbox look and behavior
  across all platforms
2020-04-25 15:19:07 -04:00
Raymond Hill
fe94aa331a
Replace CodeMirror resize code with CSS flex 2020-04-25 10:19:08 -04:00
Raymond Hill
468f4d6b8e
Fix power button color in classic popup panel
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/g7i95t/
2020-04-25 08:03:34 -04:00
Raymond Hill
9845e4d61a
Replace old resizing code with CSS flex 2020-04-24 20:10:35 -04:00
Raymond Hill
f16d77ef03
Avoid applying CSS filter twice 2020-04-24 09:46:44 -04:00
Raymond Hill
d2897db2b6
More fine tuning of user interface
Noteworthy:
- Make new popup panel better resize in desktop
  environment
- Fix button visuals in "My rules" pane
- Keep "Update now" button visible until update
  is completed
- Renaming CSS variables for consistency
2020-04-24 09:33:44 -04:00
Raymond Hill
98f19facec
More fine tuning as per feedback
Better constrast for warning color. Related feedback:
- 5bee33253f (commitcomment-38700085)

Revisit how large numbers are rendered in a
compact form in the new popup panel. Feedback
from https://crowdin.com/project/ublock pointed
out that the string to translate was flawed for
Chinese locale (and possibly in some other
locales as well).
2020-04-23 14:19:41 -04:00
Raymond Hill
0afe7c2231
More fine tuning of user interface
The rendering of the total number of blocked
requests will now be abbreviated using `M` and
`G` when the block count is respectively above
1 million and 1 billion.

The storage used figure in the Settings pane
will be rendered using KB, MB or GB.
2020-04-23 08:45:43 -04:00
Raymond Hill
b277b084d5
More fine tuning of latest UI changes 2020-04-22 11:17:58 -04:00
Raymond Hill
4eef5432a9
More fine tuning of UI 2020-04-22 09:56:37 -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
8a6dc8ee88
Minor fine tuning of some dashboard visuals
More left to do as per reference documentation:
- https://protocol.mozilla.org/
- https://material.io/
2020-04-20 09:45:18 -04:00
Raymond Hill
7f999b759f
Fix broken DOM inspector [regression]
Regression from:
- 0bcf04d3dd

Related feedback:
- https://github.com/gorhill/uBlock/commit/0bcf04d3dda2#commitcomment-38594585

The DOM inspector client code is injected as
content script, thus it must be categorized as
non-privileged code.
2020-04-19 08:33:09 -04:00
Raymond Hill
21d7c7ee3d
More fine tuning of various visuals
Summarily:
- Bring back horizontal layout for fenix popup panel
  to be used in desktop environment
- Address feedback from
  https://github.com/gorhill/uBlock/commit/54b68ebd9426#commitcomment-38549940
- Allow future dark theme to be enabled programmatically
2020-04-18 09:48:53 -04:00
Raymond Hill
54b68ebd94
Fine tune various visuals
Related feedback:
- e917213e81 (commitcomment-38533349)
2020-04-16 08:49:34 -04:00
Raymond Hill
b20e33ff18
Fine tune CSS to restore intended visuals on fenix 2020-04-14 09:15:36 -04:00
Raymond Hill
7f55e5d54d
Fine tune CSS and fix CSS regressions in last commit
Related commit:
- e917213e81

Specifically, intended font size was no longer
set properly for mobile in popup panel.
2020-04-13 16:40:12 -04:00
Raymond Hill
e917213e81
Sixth pass to re-design the dashboard
Related commits:
- 0662767dd6
- 99b2a0a761
- a8e3118fea
- 453f5450b6
- a45a21f337

This commit focuses on implementing the use of
CSS `var(...)` throughout so as to make it easy
to create themes -- a requirement for uBO to
support a dark theme.

There is still work to do regarding converting
uBO's CSS to completely support `var(...)` but
being able to start using theming will help
complete and fine tune CSS `var(...)` support.

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/401
2020-04-13 09:19:58 -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
99b2a0a761
Fourth pass to re-design the dashboard
Related commits:
- a8e3118fea
- 453f5450b6
- a45a21f337

Roughly, the changes in this commit:
- Make it easier to implement a dark theme eventually:
  - Flatten the look of buttons
  - Remove the use of `opacity` style property as a
    color modifier
- Some work toward removing dependency on FontAwesome
  font
2020-04-10 18:17:12 -04:00