Commit graph

2343 commits

Author SHA1 Message Date
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
Raymond Hill
ba81f79d1b
Limit count badges of per-site tools to 99 in the popup panel
This is a revised fix as per feedback in the following issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/279#issuecomment-449531436
2018-12-22 11:19:44 -05:00
Raymond Hill
b9b0c3fba4
Remove the (confusing) "eventful" logger output filtering expression
This will render the following issue obsolete:
- https://github.com/uBlockOrigin/uBlock-issues/issues/349
2018-12-22 08:41:05 -05:00
Raymond Hill
ea3e3b6440
Inject inline-script logger scriptlet at document_end
Feedback from related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/343#issuecomment-449529429
2018-12-22 08:33:42 -05:00
Raymond Hill
c8fcdedc44
Report inline script tags in logger if present in document
Related issue:
    - https://github.com/uBlockOrigin/uBlock-issues/issues/343
2018-12-21 14:17:47 -05:00
Raymond Hill
e9d76b3575
Report inline script tags in logger if present in document
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/343
2018-12-21 14:16:17 -05:00
Raymond Hill
30093dc990
Remove (broken) benchmark pane 2018-12-21 12:02:23 -05:00
Raymond Hill
610ca2684b
Remove (broken) benchmark pane 2018-12-21 12:01:24 -05:00
Raymond Hill
2849dbb805
Fix duplicate entry in URL filtering dialog: https://github.com/gorhill/uBlock/issues/3401 2018-12-21 10:09:29 -05:00
Raymond Hill
21593dbfdd
Fix broken link 2018-12-21 08:41:53 -05:00
Raymond Hill
abd5a975ba
Further fine tune layout for small screen devices; use SVG for icon
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/348
- https://github.com/uBlockOrigin/uBlock-issues/issues/249
2018-12-21 08:16:24 -05:00
Raymond Hill
aeff011d4c
Remove obsolete comment 2018-12-21 07:32:23 -05:00
Raymond Hill
55f2014e8c
Fine tune layout fix: https://github.com/uBlockOrigin/uBlock-issues/issues/348 2018-12-21 07:31:11 -05:00
Raymond Hill
0ce42fa23d
Apply fix to diff code as per http://www.mathertel.de/Diff/DiffTest.aspx?oldfile=Diff.cs.v1&newfile=Diff.cs.v2 2018-12-20 18:57:06 -05:00
Raymond Hill
423deceb01
Import translation work from https://crowdin.com/project/ublock 2018-12-20 17:38:14 -05:00
Raymond Hill
291b08a8e6
Fine tune the space between power button and basic tools 2018-12-20 17:31:56 -05:00
Raymond Hill
3730d7d128
Fix https://github.com/uBlockOrigin/uBlock-issues/issues/40 2018-12-20 17:29:39 -05:00
Raymond Hill
04d17a3d84
Fix missing reload icon in filter creation dialog
Regression from bb737e29d5
2018-12-20 08:57:14 -05:00
Raymond Hill
ef97379e89
Possibly fix https://github.com/uBlockOrigin/uBlock-issues/issues/348, need to confirm with next dev build 2018-12-20 08:52:23 -05:00
Raymond Hill
540c311438
Fix https://twitter.com/arneblankerts/status/1075402247725637633, regression @ d3a3505a54 (diff-1c951eedcd0be2e11c02da8fabcc46b5R380) 2018-12-19 17:44:17 -05:00
Raymond Hill
6bc22ab4ba
Convert uBO's svg-based icon into a stylable svg symbol-based icon 2018-12-19 16:21:23 -05:00
Raymond Hill
42d337c706
Import translation work from https://crowdin.com/project/ublock 2018-12-19 14:10:54 -05:00
Raymond Hill
bb737e29d5
Revert use of Fontawesome v5; use 4.7 or equivalent: see <>https://github.com/uBlockOrigin/uBlock-issues/issues/249#issuecomment-448587658 2018-12-19 14:05:19 -05:00
Raymond Hill
350c106d41
Add attribution for Fontawesome 5 2018-12-18 18:03:56 -05:00
Raymond Hill
feed1180b9
Import translation work from https://crowdin.com/project/ublock 2018-12-18 17:28:24 -05:00
Raymond Hill
61d95aa60f
Move builtin filter expr button inside input field 2018-12-18 17:23:03 -05:00
Raymond Hill
0dcd77d352
Import translation work from https://crowdin.com/project/ublock 2018-12-18 16:52:27 -05:00
Raymond Hill
2b84bdcc83
Improve contextual information for translators 2018-12-18 16:37:07 -05:00
Raymond Hill
f4138fbff5
minor visual fine tuning to popup panel header 2018-12-18 16:24:37 -05:00
Raymond Hill
5dca5285e2
Fix regression introduced in 9b27a98f90 (diff-f7413cbfa6561a980810c682fa4b1a12R638) 2018-12-18 14:00:23 -05:00
Raymond Hill
2e7654d429
Relax semantic of leading/trailing pipes in filter expressions in logger 2018-12-18 13:37:01 -05:00
Raymond Hill
79905aa798
Fix https://github.com/uBlockOrigin/uBlock-issues/issues/279; partially fix https://github.com/uBlockOrigin/uBlock-issues/issues/249 2018-12-18 13:35:44 -05:00
Raymond Hill
56f7505ad8
Further improve logger along with fixes to specific logger issues
- Add tooltip support (not yet complete):
  https://github.com/gorhill/uBlock/issues/1222
- Add a link to logger documentation:
  https://github.com/gorhill/uBlock/issues/2876#issuecomment-322905413
- Migrate to from fontawesome font to svgs:
  https://github.com/uBlockOrigin/uBlock-issues/issues/249
2018-12-17 13:54:17 -05:00
Raymond Hill
9d756147cf
Start work toward fixing https://github.com/uBlockOrigin/uBlock-issues/issues/249 2018-12-17 13:53:24 -05:00
Raymond Hill
dfcd23197d
Fix parsing of redirect= option as per 67e06f53b4 (commitcomment-27803901) 2018-12-17 07:46:04 -05:00
Raymond Hill
b0da5df0a0
include "scripting" in row filterer builtin "script" expression 2018-12-16 15:33:03 -05:00
Raymond Hill
aa50dc00d2
add built-in expressions to logger's row filterer (see #787) 2018-12-16 15:26:38 -05:00
Raymond Hill
d3a3505a54
fix regression in 8f05a2f8d3 (related issue: #3683) 2018-12-16 09:17:26 -05:00
Raymond Hill
8214a0b17d
Improve tooltip for partyness information in logger 2018-12-15 12:23:13 -05:00
Raymond Hill
261ef8c510
Add support for procedural :not to HTML filtering
Related issue: <https://github.com/gorhill/uBlock/issues/3683>

Additionally, improve compile-time error reporting in the logger
2018-12-15 10:46:17 -05:00
Raymond Hill
d2a7ada0b0
fix https://github.com/uBlockOrigin/uBlock-issues/issues/341 2018-12-14 17:55:22 -05:00
Raymond Hill
8f05a2f8d3
fix https://github.com/uBlockOrigin/uBlock-issues/issues/341, and further work for https://github.com/gorhill/uBlock/issues/3683 2018-12-14 15:25:18 -05:00
Raymond Hill
932c13bfa0
drop deprecated windowType from windows.get() 2018-12-14 14:15:43 -05:00
Raymond Hill
5b7a3c9983
fix https://github.com/uBlockOrigin/uBlock-issues/issues/256; add regex support in logger filter field 2018-12-14 11:01:21 -05:00
Raymond Hill
2f1d319072
code review: don't remember tabless network requests in behind-the-scene scope 2018-12-14 08:47:29 -05:00
Raymond Hill
1d7e3e8f82
fix https://github.com/uBlockOrigin/uBlock-issues/issues/339 2018-12-14 07:03:19 -05:00
Raymond Hill
9b27a98f90
Fix https://github.com/gorhill/uBlock/issues/3654
Additionally, there has been refactoring work done regarding
filtering context used throughout uBO, motivated by the fix
here.
2018-12-13 12:30:54 -05:00
Raymond Hill
90c073882e
fix not discarding empty hostnames: 912af3284d (commitcomment-31608689) 2018-12-08 17:23:36 -05:00
Raymond Hill
a34254122a
release indexeddb ref when unused; promisify some io code 2018-12-07 16:51:18 -05:00
gwarser
cb9acd7028 fix https://github.com/uBlockOrigin/uBlock-issues/issues/332 (#3746) 2018-12-06 13:29:25 -05:00
Raymond Hill
969900efa5
import translation work from https://crowdin.com/project/ublock 2018-12-06 10:23:49 -05:00
Raymond Hill
3075582c72
fix https://github.com/uBlockOrigin/uBlock-issues/issues/314 2018-12-06 10:18:19 -05:00
Raymond Hill
96703325ea
fix https://github.com/uBlockOrigin/uBlock-issues/issues/225 2018-12-06 09:36:41 -05:00
Raymond Hill
f655223779
fix https://github.com/uBlockOrigin/uBlock-issues/issues/292 2018-12-06 09:29:17 -05:00
Raymond Hill
ed265e5f68
fix https://github.com/uBlockOrigin/uBlock-issues/issues/331 2018-12-06 08:50:13 -05:00
Raymond Hill
e7d4aff2a2
fix https://github.com/uBlockOrigin/uBlock-issues/issues/328 2018-12-05 19:18:20 -05:00
Raymond Hill
0d6a18207a
fix https://github.com/uBlockOrigin/uBlock-issues/issues/329 2018-12-05 15:57:41 -05:00
Raymond Hill
1b6fea16da
3rd-gen hntrie, suitable for large set of hostnames 2018-12-04 13:02:09 -05:00
Raymond Hill
bf28a83e2d
code review re cd7b1c0eb4 2018-12-03 08:07:54 -05:00
Raymond Hill
cd7b1c0eb4
fix https://github.com/uBlockOrigin/uBlock-issues/issues/325 2018-12-02 21:41:28 -05:00
Raymond Hill
c3b0fd31f6
import translation work from https://crowdin.com/project/ublock 2018-12-01 08:57:37 -05:00
Raymond Hill
75d9cf3055
fix https://github.com/uBlockOrigin/uBlock-issues/issues/313 2018-11-26 12:02:32 -05:00
Raymond Hill
bf266eb757
recompile wat file using latest https://github.com/WebAssembly/wabt/releases 2018-11-25 12:12:07 -05:00
Raymond Hill
5d98a88093
revert unintended stray change from commit 4504040344 2018-11-24 12:21:25 -05:00
Raymond Hill
95ffc138f2
import translation work from https://crowdin.com/project/ublock 2018-11-24 12:11:58 -05:00
Raymond Hill
4504040344
minor code review: do not cache hostname/domain pairs when parsing filters 2018-11-24 12:09:27 -05:00
Raymond Hill
2a91a685ce
code review: fix handling of too long needles 2018-11-19 14:04:26 -05:00
Raymond Hill
a3051842bb
fix returning the wrong value (re https://github.com/uBlockOrigin/uBlock-issues/issues/6) 2018-11-18 05:56:13 -05:00
Raymond Hill
e39ecc466f
import translation work from https://crowdin.com/project/ublock 2018-11-17 05:59:29 -05:00
Raymond Hill
2189f020df
add new advanced setting to disable use of WASM for dev purpose 2018-11-16 10:19:06 -05:00