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

3129 Commits

Author SHA1 Message Date
Raymond Hill
bfa6493abe
Import translation work from https://crowdin.com/project/ublock 2020-06-10 12:29:22 -04:00
Raymond Hill
6926030b68
Expand static parser to better detect invalid syntax
Specifically:

There can't be more than one `redirect` or `csp`
option.

There can be no type specified when there is a
`csp` option.

There must be one single network-related type when
there is a `redirect` option. Since `empty` and
`mp4` imply a `redirect` and a network-related
type, these can't be used along another `redirect`
or network-related type.

Related commit:
- 01b1ed9a98
2020-06-10 12:15:50 -04:00
Raymond Hill
d784fda98b
Fix matching of filters with trailing ^|
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/h08132/can_we_enable_javascript_on_the_homepage_but/ftkxvc5/

The right bound of the match needs to be incremented
when a trailing `^` matches a character.
2020-06-10 09:53:21 -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
58c6baf0ba
Syntax highlight dubious patterns
Network filters with dubious patterns are discarded
by the static network filtering engine.
2020-06-08 08:53:29 -04:00
Raymond Hill
5752ad58b8
Code review of option iterator code
Related commit:
- 01b1ed9a98

Reuse returned item each time the iterator is
restarted.
2020-06-07 19:30:30 -04:00
Raymond Hill
41523d21db
Prepare static parser to better detect invalid filters
Additionally, syntax-color invalid regular expression.
2020-06-07 11:55:27 -04:00
Raymond Hill
7dc962281f
Set max token length on parser for consistent compilation
Reported internally. The issue could cause the logger
to be unable to successfully reverse-lookup a filter
list for a filter which had tokens longer than 6
characters followed by wildcard.

Regression from:
- 01b1ed9a98
2020-06-07 08:50:20 -04:00
Raymond Hill
f869348d1f
Fix string slice extraction from parser
Reported internally.

Regression from:
- 01b1ed9a98

The regression was made apparent be the fact that
AdGuard filter lists have lines ending with the
CR character.
2020-06-07 07:40:00 -04:00
Raymond Hill
0d1a532bfa
Disregard possible trailing carriage return characters
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1101
2020-06-06 17:42:21 -04:00
Raymond Hill
b34e6da6ec
Split fetching settings/storage used in Settings pane
Computing storage-used figures can take longer than
usual sometimes when a lot of filter lists are enabled,
and this can cause the Settings pane to take longer to
be filled the first time it is opened. Fetching
settings and storage-used figures separately removes
that potential delay (they were fetched together in
a single Promise.all() call).
2020-06-06 08:45:24 -04:00
Raymond Hill
2ba4312a8b
Minor fine-tuning of CSS color 2020-06-05 10:00:35 -04:00
Raymond Hill
6633e2635d
Fix dealing with trailing newline characters
Regression from:
- 01b1ed9a98

The new parser needs to be able to deal with trailing
newline characters, which if present will be interpreted
as trailing spaces.
2020-06-05 09:57:48 -04:00
Raymond Hill
f075ba388f
Import translation work from https://crowdin.com/project/ublock 2020-06-04 07:32:07 -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
46197a11c5
Possibly fix popup document not being found
This is a blind fix attempt, related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1085
2020-05-31 07:08:24 -04:00
Raymond Hill
72e6ccce8a
Import translation work from https://crowdin.com/project/ublock 2020-05-29 07:24:41 -04:00
Raymond Hill
3508d476ff
Fix bad logger output for miss set of hostnames
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1076
2020-05-29 07:19:23 -04:00
Raymond Hill
fd90776a25
Import translation work from https://crowdin.com/project/ublock 2020-05-27 07:47:23 -04:00
Raymond Hill
a974562f7e
Expand HTML entities in title attribute
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1074
2020-05-27 06:54:11 -04:00
Raymond Hill
f6d664ba34
Import translation work from https://crowdin.com/project/ublock 2020-05-26 09:36:17 -04:00
Raymond Hill
cd1fef2d5c
On re-consideration, remove popupPanelGodMode
`filterAuthorMode` is sufficient to enable the
ability to create _allow_ rules from popup panel.
2020-05-25 07:08:02 -04:00
Raymond Hill
8310e91e0e
Fix mixing hostname and entity in domain= option
Reported internally.

Related commit:
- 3c67d2b89f
2020-05-25 07:02:49 -04:00
Raymond Hill
b61ce3600a
Import translation work from https://crowdin.com/project/ublock 2020-05-24 11:10:17 -04:00
Raymond Hill
3c67d2b89f
Add support for entity-matching in domain= filter option
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1008

This commit adds support entity-matching in the filter
option `domain=`. Example:

    pattern$domain=google.*

The `*` above is meant to match any suffix from the Public
Suffix List. The semantic is exactly the same as the
already existing entity-matching support in static
extended filtering:

- https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#entity

Additionally, in this commit:

Fix cases where "just-origin" filters of the form `|http*://`
were erroneously normalized to `|http://`. The proper
normalization of `|http*://` is `*`.

Add support to store hostname strings into the character
buffer of a hntrie container. As of commit time, there are
5,544 instances of FilterOriginHit, and 732 instances of
FilterOriginMiss, which filters require storing/matching a
single hostname string. Those strings are now stored in the
character buffer of the already existing origin-related
 hntrie container. (The same approach is used for plain
patterns which are not part of a bidi-trie.)
2020-05-24 10:46:16 -04:00
Raymond Hill
196746386c
Double-tap ctrl key to toggle god mode in popup panel
After many feedback:
- https://github.com/gorhill/uBlock/commit/aec2f81884c5#commitcomment-39385794

This is convenient enough and this still fulfill
the idea of not being able to create mindlessly
allow_ rules.
2020-05-23 19:48:28 -04:00
Raymond Hill
a018937792
Use ctrl-spacebar instead of spacebar to toggle god mode
Related feedback:
- https://github.com/gorhill/uBlock/commit/aec2f81884c5#commitcomment-39385794
2020-05-23 09:26:21 -04:00
Raymond Hill
aec2f81884
Add ability to toggle god mode in popup panel
Pressing spacebar will toggle god mode in popup
panel.

This capability shouldn't encourage people to
misuse _allow_ rules as having to press the
space bar act as an extra necessary step which
purpose is to make the creation of _allow_ rules
more mindful.
2020-05-23 06:37:04 -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
7b140a139e
Import translation work from https://crowdin.com/project/ublock 2020-05-22 10:14:08 -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
ae93c6eb31
Import translation work from https://crowdin.com/project/ublock 2020-05-20 13:53:22 -04:00
Raymond Hill
a5a447186b
Fix computing the path of nested lists
Regression from:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1034

Nested lists must have their path computed from their
parent list path, not from the path of the root list.
2020-05-20 12:38:41 -04:00
Raymond Hill
238d31c319
Import translation work from https://crowdin.com/project/ublock 2020-05-19 11:31:00 -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
5229e0c810
Ensure either .desktop or .mobile class is set
One of these must always be present. This commit
fixes a theoretical case where neither of these
classes are set on the body element.
2020-05-19 10:29:09 -04:00
Raymond Hill
e9f9b5f622
Remove unused CSS file 2020-05-19 10:28:40 -04:00
Raymond Hill
f0a445b4e9
Import translation work from https://crowdin.com/project/ublock 2020-05-18 15:15:28 -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
a760ae3e3c
Import translation work from https://crowdin.com/project/ublock 2020-05-18 08:15:17 -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
8169614b46
Import translation work from https://crowdin.com/project/ublock 2020-05-17 09:00:08 -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
009b939d7a
Import translation work from https://crowdin.com/project/ublock 2020-05-16 09:43:58 -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
8ceed3d4ca
Fix !#include directive when loading from packaged lists
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1034
2020-05-15 18:06:14 -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
6c9a43b99a
Remove stray test case from popup panel HTML code
Related feedback:
- https://github.com/gorhill/uBlock/commit/9a6feb34d546#r39207667
2020-05-15 13:45:00 -04:00
Raymond Hill
bb873cc776
Import translation work from https://crowdin.com/project/ublock 2020-05-15 12:13:54 -04:00
Raymond Hill
4fa5c6b88e
Fix uselessly allocating one extra WASM page
spotted as a result of stepping in the code. The issue
is that a uBP "page size" might differ from a WASM
page size, which is always 65536 bytes.
2020-05-15 12:03:05 -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
f060bb5382
Replace FilterPlainHostname with composite filter
FilterPlainHostname, an atomic filter unit, has been
removed and is being replaced with a composite filter
made of a pattern filter and a filter which test
hostname boundaries.

Doing so enables filters formerly being represented
by FilterPlainHostname to be now represented as a
plain pattern, and thus to be potentially stored in
a bidi-trie.

Comparing the new filter histogram with the previous
one:

FilterPatternPlain      24612   26432    1820
FilterComposite         17656   17125    -531
FilterPlainTrie Content 12977   13519     542
FilterPlainHostname      2904       0   -2904
FilterBucket             2121    1961    -160
FilterPlainTrie          1418    1578     160

Which means:
- An extra 542 patterns could be stored in bidi-tries
- There are 531 less composite filters needed
- An extra 160 buckets could be aggregated into 160
  bidi-trie

Memory-wise, it's a marginal gain (as per Chromium's
Javascript VM instance figure) -- i.e. not worth
talking about). CPU-wise, no measurable difference.

The benefit is that I consider this conceptually
simplifies slightly the static network filtering
code base.
2020-05-15 11:00:16 -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
cb08358449
Import translation work from https://crowdin.com/project/ublock 2020-05-13 07:53:08 -04:00
Raymond Hill
3d3cd58d9f
Properly auto-toggle on firewall pane [regression]
... when enabling advanced user mode. A regression
caused the pane to be toggled to hidden state instead
of being toggled to shown state.
2020-05-12 12:08:32 -04:00
Raymond Hill
1b54c5eccd
Import translation work from https://crowdin.com/project/ublock 2020-05-12 10:18:26 -04:00
Raymond Hill
19e6936ed9
Do not show per-site switches at first install time
I meant to not show the per-site switches by default
at first install. I caught this misconfiguration after
testing a first-install scenario.
2020-05-12 10:11:24 -04:00
Raymond Hill
8eab156901
Don't block on default Inter font loading 2020-05-11 17:50:53 -04:00
Raymond Hill
bb8945a629
Import translation work from https://crowdin.com/project/ublock 2020-05-11 08:07:52 -04:00
Raymond Hill
f842ab6d3c
Add new scriptlet to allow blocking Amazon's apstag.js
Related issues:
- https://github.com/NanoMeow/QuickReports/issues/3717
- https://www.reddit.com/r/uBlockOrigin/comments/ghjqph/

The specific issue on the mentioned site is that the
site's code expect `window.apstag.fetchBids` to call
client-supplied function. The new scriptlet defuse this
by calling the client code with an empty array.
2020-05-11 07:57:14 -04:00
Raymond Hill
cb719f9280
Import translation work from https://crowdin.com/project/ublock 2020-05-10 07:43:30 -04:00
Raymond Hill
b94b2834d7
Fire tune CSS in new popup panel 2020-05-10 07:39:59 -04:00
Raymond Hill
c42f23c131
Rerrange popup panel layout initializing code
Specifically, the sticky controls box is re-parented
pre-emptively instead of waiting for the decision as
to whether the panel must be toggled into a vertical
layout mode.
2020-05-08 09:16:20 -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
4540b7d19c
Import translation work from https://crowdin.com/project/ublock 2020-05-07 15:47:08 -04:00
Raymond Hill
b226873bdb
Wait a bit longer before testing viewport width 2020-05-07 15:42:30 -04:00
Raymond Hill
2d960cf530
Test against window.innerWidth to toggle vertical layout 2020-05-07 15:24:39 -04:00
Raymond Hill
80b758e18d
Let the platform pick the default suspend state at launch
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1004

The fix is trivial enough that I feel confident to make
it part of current RC cycle. There are many reports of
block page at launch on Chromium.

The fix is to let the platform pick it's natural suspend
state rather than force it. Once advanced settings are
read, the suspend state will for toggled only if
`suspendTabsUntilReady` is either `yes` or `no`. This
there should no longer be blocked page on Chromium at
launch when using default settings.

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/gac2h8/
2020-05-06 20:30:58 -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
6c9f01bf9f
Import translation work from https://crowdin.com/project/ublock 2020-05-06 10:44:15 -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
6c90cdae3a
Avoid fractional pixel in viewport height
Fractional pixel could lead to minor scrollbar
glitch -- reported internally.
2020-05-05 07:08:38 -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
a1ef8b3ec8
Fix power button not rendering on Firefox 68 ESR
Related feedback:
- https://github.com/gorhill/uBlock/commit/1f91e527464b#commitcomment-38930600

Looking through MDN documentation, I am unable to
understand why this was broken on Firefox 68 ESR while
this worked fine on Firefox 75.
2020-05-04 11:34:21 -04:00
Raymond Hill
e2e1558d57
Import translation work from https://crowdin.com/project/ublock 2020-05-03 12:57:42 -04:00
Raymond Hill
5be0be7881
Report popup/popunder when using 'other' filter in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1007
2020-05-03 12:53:13 -04:00
Raymond Hill
002a825891
Add tolerance to popup panel when checking viewport width
I meant to add this to last commit:
- a54718862c
2020-05-03 09:26:19 -04:00
Raymond Hill
a54718862c
Maybe fix rare spurious viewport width test in popup panel
In rare instances -- though it definitely happens
eventually -- the popup panel viewport width is seen as
insufficiently wide enough and as a result the popup panel
is toggled into vertical-layout mode.

The added code uses animation frames to delay the
code testing the viewport width. Hopefully this will
work.
2020-05-03 09:18:53 -04:00
Raymond Hill
1f91e52746
Simplify HTML a bit 2020-05-02 19:00:44 -04:00
Raymond Hill
f2ab319c50
Import translation work from https://crowdin.com/project/ublock 2020-05-02 18:31:37 -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
c56607fe27
Use encodeURIComponent() instead of encodeURI()
Related issue:
- https://github.com/NanoAdblocker/NanoCore/issues/325
2020-05-02 07:20:17 -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
206d217e14
Fix persist/revert tools not being shown after changes
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/733#issuecomment-621933750
2020-05-01 07:51:45 -04:00
Raymond Hill
fd08531b27
Import translation work from https://crowdin.com/project/ublock 2020-05-01 07:45:46 -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
eeae4b2cab
Add ability to open the dashboard with a keyboard shortcut
Related feedback:
- https://github.com/gorhill/uBlock/commit/9a6feb34d546#commitcomment-38852663
2020-04-30 10:31:23 -04:00
Raymond Hill
1a0cded43f
Make popup panel more/less buttons easier to click 2020-04-30 09:32:32 -04:00
Raymond Hill
2f912773b5
Import translation work from https://crowdin.com/project/ublock 2020-04-30 07:35:47 -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
018265272d
Import translation work from https://crowdin.com/project/ublock 2020-04-29 10:03:41 -04:00
Raymond Hill
23633b388d
Fix reported "Storage used:" when info is not available 2020-04-29 10:00:58 -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
848edbbdf6
Import translation work from https://crowdin.com/project/ublock 2020-04-28 11:24:42 -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
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
6259f88598
Add an alias for window.open-defuser scriptlet
As per request from filter list maintainers.

The alias is `nowoif`, in line with other such
defusing scriplets.
2020-04-27 11:24:41 -04:00
Raymond Hill
f7c838ef27
Import translation work from https://crowdin.com/project/ublock 2020-04-27 10:44:44 -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
37b22d0142
Import translation work from https://crowdin.com/project/ublock 2020-04-26 09:07:52 -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
bedaf87399
Import translation work from https://crowdin.com/project/ublock 2020-04-25 15:24:37 -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
525eb9f922
Lint HTML files using tidy 2020-04-25 11:31:42 -04:00
Raymond Hill
c6099d174d
Fix typos in HTML code
Related feedback:
- https://github.com/gorhill/uBlock/commit/01ab072f07f8#r38739334

Will `tidy` from now on.
2020-04-25 11:20:36 -04:00
Raymond Hill
3afe286124
Translation work from https://crowdin.com/project/ublock 2020-04-25 10:27:04 -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
01ab072f07
Add localized strings for contributions in About pane
Additionally, an entry for filter list
contributors has been added.
2020-04-24 20:17:21 -04:00
Raymond Hill
9845e4d61a
Replace old resizing code with CSS flex 2020-04-24 20:10:35 -04:00
Raymond Hill
ee2d7bfa17
Import translation work from https://crowdin.com/project/ublock 2020-04-24 09:54:48 -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
ed383bd470
Import translation work from https://crowdin.com/project/ublock 2020-04-23 10:16:56 -04:00
Raymond Hill
fea02031c1
Mind possibly too long abbreviation 2020-04-23 10:08:06 -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
04c07f3e10
Use large units for large values in Settings pane
Shorten "Storage used" values using large
units, i.e. shorten rendered values using
KB, MB, and GB for large figures.
2020-04-22 16:30:23 -04:00
Raymond Hill
64cb7fa843
Import translation work from https://crowdin.com/project/ublock 2020-04-22 16:29:57 -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
b5b72059eb
Import translation work from https://crowdin.com/project/ublock 2020-04-20 09:51:30 -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
0bcf04d3dd
Centralize access to browser.storage.local('localStorage')
Related commit:
- 2ac288397c

Instead of having the `localStorage` data being accessed
from different locations, all accesses are now funnelled
to the main process.

Doing so simplifies the code in auxiliary processes and
also remove the need for browser.storage.local.onChanged()
listeners.

No longer using an onChanged() listener also happens to
remove spurious warnings from the Firefox console.
2020-04-15 15:55:29 -04:00
Raymond Hill
042935b22a
Ensure element picker's height is not affected by web sites
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/987
2020-04-15 09:46:12 -04:00
Raymond Hill
efa3c140ab
Fix typo in last commit
Related commit:
- 36711a7c07
2020-04-14 11:57:59 -04:00
Raymond Hill
8c1a055bfe
Import translation work from https://crowdin.com/project/ublock 2020-04-14 09:19:31 -04:00
Raymond Hill
b20e33ff18
Fine tune CSS to restore intended visuals on fenix 2020-04-14 09:15:36 -04:00
Raymond Hill
36711a7c07
Fix denyallow thrown away with pure hostname patterns 2020-04-14 09:10:59 -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
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
94935a4b9e
Pure origin filters can't have denyallow option
This fixes filters of the form:

  *$[...],denyallow=[...],domain=[...]
  |http://$[...],denyallow=[...],domain=[...]
  |https://$[...],denyallow=[...],domain=[...]
2020-04-13 14:22:21 -04:00
Raymond Hill
b5d8b0a9f0
Import translation work from https://crowdin.com/project/ublock 2020-04-13 09:31:22 -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
e4065ec05c
Import translation work from https://crowdin.com/project/ublock 2020-04-11 11:41:33 -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
ebf7ade6b1
Import translation work from https://crowdin.com/project/ublock 2020-04-10 18:27:48 -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
Raymond Hill
a7dc0de98f
Update kbd shortcuts only if kbd shortcuts pane is enabled
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/386#issuecomment-611806957
2020-04-10 17:25:36 -04:00
Raymond Hill
b1cf3c46a7
Import translation work from https://crowdin.com/project/ublock 2020-04-09 09:36:34 -04:00
Raymond Hill
a8e3118fea
Third pass to re-design the dashboard
Related commits:
- 453f5450b6
- a45a21f337

This commit fixes parts of the re-design not
rendering as intended as per <https://github.com/brampitoyo>'s
feedback screenshots.

The dashboard tab buttons have been converted to
`span` tags (from `a` tags), thus eliminating
the unwanted side effect of the text being
rendered as unvisited links (blueish).

The font size intended for touch screens was not
taking effect due to bad cut & paste.

Other minor adjustments to improve consistency
in spacing.
2020-04-09 09:20:29 -04:00
Raymond Hill
03739ab96b
Add minimal-scale in meta tag 2020-04-08 10:23:40 -04:00
Raymond Hill
5a2e5cfe86
Import translation work from https://crowdin.com/project/ublock 2020-04-08 10:22:38 -04:00
Raymond Hill
4687c60bf9
Support fetching assets from CDNs when auto-updating
This commit add the ability to fetch from CDN servers
when an asset is fetched as a result of auto-update.

If an asset has a `cdnURLs` entry in `assets.json`,
the asset will be auto-updated using one of those
CDN URLs. When many CDN URLs are specified, those
URLs will be shuffled in order to spread the bandwidth
across all specified CDN servers. If all specified CDN
servers fail to respond, uBO will fall back to usual
`contentURLs` entry.

The `cdnURLs` are used only when an asset is
auto-updated, this ensures a user will get the more
recent available version of an asset when manually
updating.

The motivation of this new feature is to relieve
GitHub from acting as a CDN (which it is not) for
uBO -- an increasing concern with the growing adoption
of uBO along with the growing size of key uBO assets.
2020-04-08 09:57:55 -04:00
Raymond Hill
e8a9997de8
Import translation work from https://github.com/gorhill/uBlock 2020-04-06 14:05:16 -04:00
Raymond Hill
a45a21f337
Second pass to re-design the dashboard
Related commit:
- 453f5450b6

The changes in this commit are mostly related
to the "Filter lists" pane.

An eye icon has been added, which purpose is
to view the content of a list. Clicking on the
name of the list will toggle the list's
checkbox.
2020-04-06 14:00:19 -04:00
Raymond Hill
64d8904998
Fine tune font size for reworked dashboard UI
Related feedback:
- https://github.com/gorhill/uBlock/commit/453f5450b6e6#commitcomment-38305932

The larger font size is best justified for
touchscreen to allow tapping -- less justified
on devices with a mouse which allow for more
accurate selection.
2020-04-05 19:37:23 -04:00
Raymond Hill
453f5450b6
First pass to Re-design the dashboard
This is a first pass in which only the dashboard
navigation widget and the "Settings" pane have
been revisited.

Reference work:
- https://app.abstract.com/share/54f1465e-8d1c-4e7b-9ae4-f37e21bef7fe
2020-04-05 15:19:07 -04:00
Raymond Hill
20332c65b4
No need for "Shortcuts" pane in Firefox 74 and above
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/386
2020-04-05 09:47:22 -04:00
Raymond Hill
df08b12d48
Fix race condition at browser launch re. cosmetic filtering
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/974

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/fuscia/

The race condition was that a content script could
query the main process to retrieve cosmetic filters
while the cosmetic filters had not been yet fully
loaded into memory. The fix ensure that an already
injected content script will re-query once the
cosmetic filters are fully loaded in memory at
browser launch time.
2020-04-04 11:34:43 -04:00
Raymond Hill
1295e25961
Remove unused property 2020-04-03 09:07:22 -04:00
Raymond Hill
cc3152e803
Import translation work from https://crowdin.com/project/ublock 2020-04-03 09:02:55 -04:00
Raymond Hill
044a1dd6ee
Fix :style exception filters not being reported in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/962

Regression from:
- 72bb700568
2020-03-26 09:19:02 -04:00
Raymond Hill
0078cea6a0
Import translation work from https://crowdin.com/project/ublock 2020-03-26 08:43:30 -04:00
Raymond Hill
2f927847f2
Discard :style() filters chained to procedural operators
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/961
2020-03-26 08:38:22 -04:00
Raymond Hill
151ff5326a
Import translation work from https://crowdin.com/project/ublock 2020-03-24 12:18:33 -04:00
Raymond Hill
2fcc41f641
Improve disqus_embed.js scriptlet
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/959

The problematic site does not declare the expected
`disqus_shortname` global variable, so the scriptlet
has been extended to deal with such occurrence.
2020-03-24 10:02:20 -04:00
Raymond Hill
11d24abea0
Move proxy-detection code to Firefox-specific code
Related commit:
- https://github.com/uBlockOrigin/uBlock-issues/issues/911

The motivation is to avoid executing code which is
unnecessary on platforms not supporting the browser.dns
API.
2020-03-23 13:31:43 -04:00
Raymond Hill
0c30bee3e3
Fix typo in proxy-detecting code
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/911

Related commit:
- https://github.com/gorhill/uBlock/commit/3f7ece94691f
2020-03-23 12:23:05 -04:00
Raymond Hill
3f7ece9469
Do not cname-uncloak when a proxy is in use
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/911

Since cname-uncloaking is available only on Firefox
at the moment, the fix is relevant only to Firefox.

By default uBO will no longer cname-uncloak when it
detects that network requests are being being proxied.

This default behavior can be overriden by setting the
new advanced setting `cnameUncloakProxied` to `true`.
The new setting default to `false`, i.e. cname-uncloaking
is disabled when uBO detects that a proxy is in use.

This new advanced setting may disappear once the
following Firefox issue is fixed:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1618271
2020-03-22 14:52:58 -04:00
Raymond Hill
f5204235b7
Use prime number to generate cache-bypass token
Related discussion:
- https://github.com/gorhill/uBlock/commit/048bfd251c9b#r37972005

From <https://github.com/gwarser>:

> I think this should be "modulo prime", not 12.
> If someone always turn on PC in "8am" there is
> a slight chance to hit cache.
2020-03-22 11:31:06 -04:00
Raymond Hill
381498daa2
Reorganize filter instances deduplication code
Related commit:
- https://github.com/gorhill/uBlock/commit/ab629b9e1093
2020-03-19 13:42:06 -04:00
Raymond Hill
a36566b348
Allow empty needle in BidiTrieContainer.lastIndexOf()
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/882

Related commit:
- https://github.com/gorhill/uBlock/commit/7c0294bd5f54

The changes in the commit above have been reverted, and
the new fix is to add the ability to handle an empty
needle in BidiTrieContainer.lastIndexOf() -- in which
case the method will return the end of the currently
matched pattern.
2020-03-19 13:16:41 -04:00
Raymond Hill
20a32e881a
Import translation work from https://crowdin.com/project/ublock 2020-03-18 09:21:57 -04:00
Raymond Hill
ab629b9e10
Add filter instance deduplicater in static net filtering engine
Provide a way to optionally deduplicate filter
instances, useful for filter instances with:

- high likelihood of duplication; and
- non-trivial memory footprint per instance
  - For examples, filter instances to implement
    `domain=`, `denyallow=`, `csp=`.

Cursory tests show this helps further reduce
uBO's memory footprint.
2020-03-18 09:06:33 -04:00
Raymond Hill
ec70fba948
Import translation work from https://crowdin.com/project/ublock 2020-03-16 09:17:59 -04:00
Raymond Hill
c3bc2c741d
Add support for cname type and denyallow option
This concerns the static network filtering engine.

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

* * *

New static network filter type: `cname`

By default, network requests which are result of
resolving a canonical name are subject to filtering.
This filtering can be bypassed by creating exception
filters using the `cname` option. For example:

    @@*$cname

The filter above tells the network filtering engine
to except network requests which fulfill all the
following conditions:

- network request is blocked
- network request is that of an unaliased hostname

Filter list authors are discouraged from using
exception filters of `cname` type, unless there no
other practical solution such that maintenance
burden become the greater issue. Of course, such
exception filters should be as narrow as possible,
i.e. apply to specific domain, etc.

* * *

New static network filter option: `denyallow`

The purpose of `denyallow` is bring
default-deny/allow-exceptionally ability into static
network filtering arsenal. Example of usage:

    *$3p,script, \
        denyallow=x.com|y.com \
        domain=a.com|b.com

The above filter tells the network filtering engine that
when the context is `a.com` or `b.com`, block all
3rd-party scripts except those from `x.com` and `y.com`.

Essentially, the new `denyallow` option makes it easier
to implement default-deny/allow-exceptionally in static
filter lists, whereas before this had to be done with
unwieldy regular expressions[1], or through the mix of
broadly blocking filters along with exception filters[2].

[1] https://hg.adblockplus.org/ruadlist/rev/f362910bc9a0

[2] Typically filters which pattern are of the
    form `|http*://`
2020-03-15 12:23:25 -04:00
Raymond Hill
84d4111c05
Import translation work from https://crowdin.com/project/ublock 2020-03-15 09:34:34 -04:00
Raymond Hill
85c9e74999
Do not repeat filter content in reverse lookup dialog
No need to repeat content of filter when reverse
lookup fails in logger's dialog.
2020-03-15 09:27:38 -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
bc700e691c
Fix srcset handling in element picker
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/923

Use current page's hostname instead of that of
image URLs to decide whether to reset pattern
union with previous picker sessions.

The fixed issue arose from the fact that the
page uses URLs from different origins in a
single srcset attribute.
2020-03-15 08:45: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
2cbbc30084
Also remove text node in :remove() operator
Related discussion:
- https://github.com/gorhill/uBO-Extra/issues/119#issuecomment-537842967

As an incidental side effect, this may or may not
prevent execution of the content of some inline
script tags.
2020-03-09 11:34:49 -04:00
Raymond Hill
0f33f2386d
Expand log output of window.open-defuser 2020-03-09 10:09:40 -04:00
Raymond Hill
b27848a060
Improve window.open-defuser scriptlet
The new syntax deprecate the old syntax, though the
old syntax will still be supported until it's no
longer used in mainstream filter lists.

The new syntax is:

    example.com##+js(window.open-defuser, pattern, seconds)

`pattern`:

A pattern to match for the defusing to take place.
Patterns which starts and ends with `/` will be
interpreted as regular expressions. To NOT match a
pattern, prefix with `!`.

`seconds`:

If not present, no window will be opened and the
scriptlet will return `null`.

If present and a valid integer value, the defuser
will return a valid window object even though no
popup window is opened. The returned window object
will cease to be valid after the specified number
of seconds.
2020-03-08 16:15:58 -04:00
Raymond Hill
1d9421b8b2
Improve validation of CSS selector-based cosmetic filters
Reported internally. The following invalid filter was not
discarded by uBO:

    123tvnow.com##.123tv-ads

The correct form should be:

    123tvnow.com##.\31 23tv-ads

Not discarding invalid CSS selector-based cosmetic
filter may break CSS selector-based cosmetic
filtering.
2020-03-08 10:55:19 -04:00
Raymond Hill
72bb700568
Add procedural cosmetic operators remove() and upward()
***

New procedural cosmetic operator: `:remove()`

Related issue:
- https://github.com/gorhill/uBlock/issues/2252

The purpose is to outright remove elements from the
DOM tree. Since `:remove()` is an "action" operator,
it must only be used as a trailing operator (just
like the `:style()` operator).

AdGuard's cosmetic filter syntax `{ remove: true; }`
will be converted to uBO's `:remove()` operator
internally.

***

New procedural cosmetic operator: `:upward(...)`

The purpose is to lookup an ancestor element.

When used with an integer argument, it is synonym of
`:nth-ancestor()`, which will be deprecated and which
will no longer be supported once no longer used in
mainstream filter lists.

Filter lists maintainers must only use `:upward(int)`
instead of `:nth-ancestor(int)` once the new operator
become available in all stable releases of uBO.

`:upward()` can also accept a CSS selector as argument,
in which case the nearest ancestor which matches the
CSS selector will be selected.
2020-03-07 14:25:06 -05:00
Raymond Hill
7442463a87
Fix spurious v-scrollbar when hovering bottom-most cells 2020-03-04 13:34:50 -05:00