Commit graph

2312 commits

Author SHA1 Message Date
Raymond Hill
5d5b05b387
Fix an issue in new logger export feature
Specifically, if selecting table+markdown, the export dialog
would no longer be accessible once closed.
2019-01-14 16:52:13 -05:00
Raymond Hill
ac5bae6a65
Import translation work from https://crowdin.com/project/ublock 2019-01-14 15:10:28 -05:00
Raymond Hill
0edf53f508
Add export-to-clipboard feature to logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/334

Additionally, a number of smallish issues following
refactoring of the logger code were addressed.
2019-01-14 14:57:31 -05:00
Raymond Hill
88a54d442d
Import translation work from https://crowdin.com/project/ublock 2019-01-14 08:08:09 -05:00
Raymond Hill
3be59f172d
Use blocked/allowed colors in logger's "Details" pane
Additionally, another attempt at making the logger render
better on small-screen devices.
2019-01-13 08:34:17 -05:00
Raymond Hill
10f1fdcb7c
Import translation work from https://crowdin.com/project/ublock 2019-01-12 17:22:55 -05:00
Raymond Hill
9fd63bdbe6
Merge branch 'master' of github.com:gorhill/uBlock into nextdev 2019-01-12 17:06:07 -05:00
Raymond Hill
be0c7186a2
Import translation worl from https://crowdin.com/project/ublock 2019-01-12 17:05:41 -05:00
Raymond Hill
ed5d63df69
Grand refactoring of the logger
Performance-related work: the logger data has been decoupled
from the DOM -- inspired from CodeMirror's way of efficiently
handling large amout of text data.

This decoupling now makes the logger highly efficient CPU- and
memory-wise, and open the way to more possibilities.

Ability to configure some aspect of the logger behavior and
visuals:
- The hard-coded limit of 5000 entries has been
  removed and is now replaced with a variety of
  user-configurable settings to enforce the discarding of
  logger entries.
- Some columns in the logger output can now be hidden.

The filter list look-up feature has been merged into the
existing overlay dialog used to create URL rules or static
filters, as an entry in a new "Details" pane.

Other issues addressed during refactoring:
- https://github.com/uBlockOrigin/uBlock-issues/issues/280
- https://github.com/gorhill/uBlock/issues/1999

The minimum version supported on Firefox has been bumped
up to 55.0.
2019-01-12 16:36:20 -05:00
Raymond Hill
407aa68272
Merge branch 'master' of github.com:gorhill/uBlock into nextdev 2019-01-08 08:08:16 -05:00
Raymond Hill
f1f1892233
Import translation work from https://crowdin.com/project/ublock 2019-01-08 07:57:49 -05:00
Raymond Hill
64bea27881
Add ability to control auto-commenting at filter creation time
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/372
- https://github.com/gorhill/uBlock/issues/93

A new advanced settings has been added: `autoCommentFilterTemplate`.

Default value is `{{date}} {{origin}}`.

Placeholders are identified by `{{...}}`. There are currently
only three placeholders supported:

- `{{date}}`: will be replaced with current date
- `{{time}}`: will be replaced with current time
- `{{origin}}`: will be replaced with site information on which
  the filter(s) was created

If no placeholder is found in `autoCommentFilterTemplate`, this
will disable auto-commenting. So one can use `-` to disable
auto-commenting.

Additionally, if auto-commenting is enabled, uBO will not emit a
comment if an emitted comment would be a duplicate of the last
one found in the user filter list.
2019-01-08 07:37:50 -05:00
Raymond Hill
2c4535d1fe
Prevent spurious disappearance of built-in expression filters panel
After a bit more testing following
<38b73f7100>.

Hovering the mouse cursor over the margin area would cause the panel
to spuriously disappear.
2019-01-01 16:31:54 -05:00
Raymond Hill
dbca18ebe1
Expand built-in filter expression panel by default
In light of <38b73f7100>,
it makes sense to now have the panel expanded by default.
2019-01-01 16:31:38 -05:00
Raymond Hill
76eb3e9d03
Hide built-in expressions panel in logger when cursor leaves panel 2019-01-01 16:31:19 -05:00
Raymond Hill
24cb894aa0
Prevent spurious disappearance of built-in expression filters panel
After a bit more testing following
<38b73f7100>.

Hovering the mouse cursor over the margin area would cause the panel
to spuriously disappear.
2019-01-01 11:43:41 -05:00
Raymond Hill
0867a15d36
Expand built-in filter expression panel by default
In light of <38b73f7100>,
it makes sense to now have the panel expanded by default.
2019-01-01 11:34:24 -05:00
Raymond Hill
38b73f7100
Hide built-in expressions panel in logger when cursor leaves panel 2019-01-01 11:18:14 -05:00
Raymond Hill
d8674d8abe
Merge changes from master 2018-12-31 12:11:28 -05:00
Raymond Hill
08261e3c15
Change DOM surveyor to time-based processing logic (from chunk-based)
The DOM surveyor will now use time-based logic to spread its work
over time. This allows the surveying to better scale down on
slower devices.

Additionally, the DOM surveyor code has been reworked to lower as
much as possible memory churning when collating nodes to survey.

This rework has been motivated after profiling the "monstrous DOM"
seen in the following page:
<https://doc.rust-lang.org/std/iter/trait.Iterator.html>

The idea is that making the DOM surveyor efficient on such
"monstrous DOM" case should make it efficient everywhere in
practice.
2018-12-31 11:50:40 -05:00
Raymond Hill
f35dff2c9d
Code review related to performance in main content script
- Avoid concatenating with empty array: though the concatenated
  array is empty, this still forces the creation of a whole new
  array as per semantic of Array.prototype.concat().
  <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat>

- Do not convert arrays to strings when sending data to
  main process in surveyPhase1(): I no longer see any benefit
  doing so in profiling data (if I recall properly this was
  benefiting Firefox, but I can't remember for sure anymore why
  I chose to do so back then).
2018-12-29 16:34:46 -05:00
Raymond Hill
09fb3549f3
Improve creation of rows in dynamic filtering pane of popup panel
- Reuse existing rows without first removing them
- New rows appended all at once through DocumentFragment
2018-12-29 08:43:44 -05:00
Raymond Hill
87cf95c04b
Avoid redundant DOM attributes in dynamic filtering pane
Move redundant attributes in cells to parent row; use
Element.closest() to look-up these attributes when needed.
2018-12-29 06:54:05 -05:00
Raymond Hill
8eda70bce2
Import translation work from https://crowdin.com/project/ublock 2018-12-28 13:06:39 -05:00
Raymond Hill
4e2a8a0ce0
Fix vertical centering of hostnames in dynamic filtering pane
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/358

Additionally, use `display: none;` to unburden the browser
renderer from taking into account the `sup` element since
most of the time it is unused.
2018-12-28 12:56:56 -05:00
Raymond Hill
c78fa16e5b
Fine tune spacing of per-site switches
Hopefully this will fix the issue seen on Firefox for Android: for
some reasons, the popup panel's default size is now more zoomed
out than it used to be in latest stable release.

Additionally, I fixed the syntactically incorrect instances of
:before and :after.
2018-12-28 09:03:32 -05:00
Raymond Hill
f6dde894cb
Decrease a bit the space between extra tools at bottom of popup panel
Since the counts are now limited to two characters, no point
allocating more space than needed.
2018-12-27 11:24:32 -05:00
Raymond Hill
ab2efd1b84
Import translation work from https://crowdin.com/project/ublock 2018-12-27 10:21:25 -05:00
Raymond Hill
eb1428c8bb
Fix regression in the collapsing of blocked resources
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/356
2018-12-27 10:17:08 -05:00
Raymond Hill
8a88e9d931
Support CSS selectors mixed w/ operators in procedural cosmetic filters
Related issue:
- https://github.com/gorhill/uBlock/issues/3683

This commit further increases uBO's procedural cosmetic filters
Adguard's cosmetic filter syntax -- specifically those procedural
cosmetic filters where plain CSS selectors appeared following
a procedural oeprator (this was rejected as invalid by uBO).

Also, experimental support for `:watch-attrs` procedural
operator, as discussed in <https://github.com/uBlockOrigin/uBlock-issues/issues/341#issuecomment-449765525>.
Support may be dropped before next release depending on whether
a better solution is suggested.

Additionally, the usual opportunistic refactoring toward ES6
syntax.
2018-12-26 10:45:19 -05:00
Raymond Hill
e4cec5a15e
Add missing CSS rule for FA "exclamation-triangle" icon 2018-12-26 10:41:25 -05:00
Raymond Hill
2ba1cd7dc3
Import translation work from https://crowdin.com/project/ublock 2018-12-26 06:53:46 -05:00
Raymond Hill
0ffa4b91de
Minor code review
- Make FA icons non-selectable, because of spurious selection
  on Firefox for Android when merely tapping an icon
- Disable spellchecking in the static network filter editor
  in the logger
2018-12-25 10:28:32 -05:00
Raymond Hill
f4b9549d05
Remove use of background color style on the logger's input fields
Related feedback from the following issue:
- https://github.com/gorhill/uBlock/issues/787#issuecomment-449531979
2018-12-24 10:23:21 -05:00
Raymond Hill
be9e7fd11c
Code review related to the early blocking of network requests at launch 2018-12-24 08:56:35 -05:00
Raymond Hill
fe595bb2b9
Import translation work from https://crowdin.com/project/ublock 2018-12-24 08:11:20 -05:00
Raymond Hill
4d540f3ffa
Import translation work from https://crowdin.com/project/ublock 2018-12-23 18:04:21 -05:00
Raymond Hill
41548be6be
Move early blocking of requests out of experimental status on Firefox
Related issues:
- https://github.com/gorhill/uBlock/issues/2067
- https://github.com/uBlockOrigin/uBlock-issues/issues/128

Related mozbug issue:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1503721
2018-12-23 17:59:31 -05:00
Raymond Hill
99cdec5ba6
Informal code review to tidy up logger buffer fetching implementation 2018-12-23 15:35:32 -05:00
Raymond Hill
ddee2bff13
Import translation work from https://crowdin.com/project/ublock 2018-12-23 14:26:49 -05:00
Raymond Hill
6ac0c66813
Left-align text in "type" column in the logger
Feedback in related issue:
- https://github.com/gorhill/uBlock/issues/3654#issuecomment-449649399
2018-12-23 14:12:14 -05:00
Raymond Hill
f1567ee272
Prevent spurious wrapping of text in logger's expression picker
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/351
2018-12-23 09:18:37 -05:00
Raymond Hill
e2d1f50dd8
Normalize Adguard's plain cosmetic filters disguised as style-based filters
Reported by https://github.com/uBlock-user in
https://github.com/orgs/uBlockOrigin/teams/ublock-issues-volunteers/discussions/56

For some reasons, many cosmetic filters in Adguard's Annoyance List
are plain cosmetic filters disguised as style-based cosmetic filters,
and this was breaking uBO's ability to reverse lookup such filters
from the logger.
2018-12-23 08:58:03 -05:00
Raymond Hill
13ce898e52
Import translation work from https://crowdin.com/project/ublock 2018-12-22 15:53:26 -05:00
Raymond Hill
91144c4edc
Allow creating broad cosmetic filters directly from the picker
Using the Ctrl key while cliking an element on the page will cause
the picker to choose a broad cosmetic filter as candidate.
2018-12-22 15:44:23 -05:00
Raymond Hill
d574a09784
Make the element picker dialog slowly fade away when made discrete
This fixes the following issues:
- https://github.com/gorhill/uBlock/issues/3449
- https://github.com/uBlockOrigin/uBlock-issues/issues/55
2018-12-22 15:09:38 -05:00
Raymond Hill
69668d27b1
Ensure the text cursor in visible when a CodeMirror editor is resized
Related issues:
- https://github.com/gorhill/uBlock/issues/3706
- https://github.com/gorhill/uBlock/issues/3701
2018-12-22 13:35:46 -05:00
Raymond Hill
cd597709bb
Remember cursor position in "My filters" for next visit
Related issue:
- https://github.com/gorhill/uBlock/issues/3706
2018-12-22 13:09:56 -05:00
Raymond Hill
2be36ffe81
Fix bad alignment in comments 2018-12-22 12:26:50 -05:00
Raymond Hill
f3773ef6eb
Internationalize CodeMirror's hard-coded tooltips in the "My rules" pane
Related issue:
- https://github.com/gorhill/uBlock/issues/3708

This was brought into the issue above but I ended up forgotting
about it after I focused mostly on the second issue brought up
in there.
2018-12-22 11:55:13 -05:00