1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 08:37:11 +02:00
Commit Graph

170 Commits

Author SHA1 Message Date
Raymond Hill
3e7eca364b
Make logger console filter expression case-insensitive 2024-05-14 11:58:53 -04:00
Raymond Hill
6e61a13e40
Open details pane only when clicking non-interactive elements
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3202
2024-04-11 11:12:37 -04:00
Raymond Hill
3b4f02db21
Add a console pane to the logger
The console pane will report logging information reported by
scriptlets.

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3096#discussioncomment-8748932

Plus other changes.
2024-04-10 11:27:40 -04:00
Raymond Hill
1cb190e102
Append wildcard character only when filter starts & ends with /
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/1088
2024-03-14 13:32:36 -04:00
Raymond Hill
7ab7104a54
Clicking again currently inspected row will close the dialog 2024-03-02 09:37:15 -05:00
Raymond Hill
59d46ecd78
Postprocess selections only from from logger entries
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3097
2024-01-28 11:17:36 -05:00
Raymond Hill
55e4cee6e8
Discard repeating adjacent entries in the logger 2024-01-26 09:24:10 -05:00
Raymond Hill
49a6dc868f
Fix verbose mode not applying to newly injected scriptlets
Related commit:
869a653fdf
2024-01-25 13:30:41 -05:00
Raymond Hill
869a653fdf
Output scriptlet logging information to the logger
This commit brings the following changes to the logger:

All logging output generated by injected scriptlets are now sent to
the logger, the developer console will no longer be used to log
scriptlet logging information.

When the logger is not opened, the scriplets will not output any
logging information.

The goal with this new approach is to allow filter authors to
more easily assess the working of scriptlets without having to
go through scriptlet parameters to enable logging.

Consequently all the previous ways to tell scriptlets to log
information are now obsolete: if the logger is opened, the
scriptlets will log information to the logger.

Another benefit of this approach is that the dev tools do not
need to be open to obtain scriptlets logging information.

Accordingly, new filter expressions have been added to the logger:
"info" and "error". Selecting the "scriptlet" expression will also
keep the logging information from scriptlets.

A new button has been added to the logger (not yet i18n-ed): a
"volume" icon, which allows to enable verbose mode. When verbose
mode is enabled, the scriptlets may choose to output more
information regarding their inner working.

The entries in the logger will automatically expand on mouse hover.
This allows to scroll through entries which text does not fit into
a single row.

Clicking anywhere on an entry in the logger will open the detailed
view when applicable.

Generic information/errors will now be rendered regardless of which
tab is currently selected in the logger (similar to how tabless
entries are already being rendered).
2024-01-25 12:20:38 -05:00
Raymond Hill
a9eb9630cf
Do not use tab character as field separator
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2730#issuecomment-1881821674

Character `\x1F` is now used instead.
2024-01-09 14:31:00 -05:00
Raymond Hill
f81d71c6e8
Mind type of drop event items
Related feedback:
https://github.com/gorhill/uBlock/commit/c8b7d1a526#commitcomment-135590810
2023-12-22 11:45:35 -05:00
Raymond Hill
c8b7d1a526
Mind drop events in filter expression field of logger
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/issues/3036#issuecomment-1867497436
2023-12-22 10:45:43 -05:00
Raymond Hill
49c8310e22
Fix message entry overflowing in logger
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3021
2023-12-21 12:02:57 -05:00
Raymond Hill
a969a672e0
Change official description in source code top comment 2023-12-04 12:10:34 -05:00
Raymond Hill
c744c87607
Reset the DOM inspector when URL in top context changes
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/542
2023-12-04 08:07:53 -05:00
Raymond Hill
9bd483bec3
Enable "not permissions" filtering expression in logger
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2714#discussioncomment-6959861
2023-10-22 17:50:45 -04:00
Raymond Hill
dde246f202
Do not issue extraneous doc separators in logger 2023-08-17 09:28:29 -04:00
Raymond Hill
60b21b1422
Prevent negative position when widget size is greater than viewport size
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2718
- https://github.com/uBlockOrigin/uBlock-issues/issues/2704
2023-07-03 07:14:52 -04:00
Raymond Hill
b44815f0c8
Ensure no negative value for top property of floating widget in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2704
2023-06-30 11:45:34 -04:00
Raymond Hill
d506b28a48
Patch Unicode country flags with image-based flags
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2645
2023-05-20 21:35:52 -04:00
Raymond Hill
bc02358610
Use a different surface color for scriptlets in logger
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2636
2023-05-06 18:56:00 -04:00
Raymond Hill
91f9795023
Wrap usage of setTimeout in helper for background + auxiliary pages
This commit centralizes usage of setTimeout()/clearTimeout() in the
source code at one single location.
2023-04-09 13:38:16 -04:00
Raymond Hill
b4ae2d3bf4
Make object equivalent of frame for dynamic filtering purpose
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2496
2023-03-31 09:37:53 -04:00
Raymond Hill
3d1c696e20
Support view source of "other" type 2023-03-30 12:29:02 -04:00
Raymond Hill
4b6ce5e402
Cleanup unused code
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1529
- https://github.com/uBlockOrigin/uBlock-issues/discussions/1958#discussioncomment-5257148
2023-03-12 10:08:20 -04:00
Raymond Hill
7bfa8f260b
Just select already existing tab when opening link from logger 2023-03-11 09:40:34 -05:00
Raymond Hill
bd84a7c8d5
Support rendering xhr requests in new code viewer
Related commit:
- 33c437f99f
2023-03-07 13:40:52 -05:00
Raymond Hill
33c437f99f
Add source code viewer (from logger)
This commits add the ability to open html/css/script
resources from the logger, as a formatted and syntax-
highligthed document.

The goal is to make it easier for filter list authors to
investigate filter-related issues.
2023-03-01 11:04:40 -05:00
Raymond Hill
191f2f00d6
Put back reload button in logger's "Details" dialog
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2497#discussioncomment-5100726
2023-02-24 18:00:16 -05:00
Raymond Hill
e740068691
Support moving logger dialog around with touch events
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2497
2023-02-19 18:41:57 -05:00
Raymond Hill
988a352cc4
Fine tuning the logger's entry tools positioning
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/10483e5/new_logger_functions_in_latest_dev_build_ubo/j33tx0y/
2023-01-06 10:16:24 -05:00
Raymond Hill
7847731e9a
Remember position entry tools widget in logger
Related feedback:
- a9405fe36c (commitcomment-95164238)
2023-01-05 12:49:02 -05:00
Raymond Hill
5e45c7249a
Add more columns in logger for bringing up entry details 2023-01-05 09:08:26 -05:00
Raymond Hill
a9405fe36c
Make the logger entry dialog modeless 2023-01-04 13:43:12 -05:00
Raymond Hill
3f71659aa8
Work related to keyboard shortcuts for page reload
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/896

Additionally, added the keyboard shortcuts to reload the current
tab to the logger. This changes the prior behavior of reloading
the logger content itself.
2022-12-25 10:34:53 -05:00
Raymond Hill
6a50f41aeb
Internal cell count !== visual cell count
Internal cell count is used to filter the output of the logger. This
commit fixes filtering according to cname alias.
2022-12-24 10:30:25 -05:00
Raymond Hill
b194baa089
Fix visual regressions in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2425
2022-12-24 10:04:31 -05:00
Raymond Hill
b6981877ba
Add option to filter by HTTP method in static network filters
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2117

Option: `method=`
Value: a list of `|`-separated lowercased method names. Negated
method names are allowed. These are valid methods:

- connect
- delete
- get
- head
- options
- patch
- post
- put

As per DNR's own documentation:
- https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-RequestMethod

The logger shows the method used for every network request. It's
possible to filter the logger output for most-common methods: `get`,
`head`, `post`.
2022-12-22 13:15:08 -05:00
Raymond Hill
fa5e4b7769
Fine tune new exceptor code
Related feedback:
- a91781a495 (commitcomment-93128519)

For instance, do not make exceptor widget available for
exceptions from filter lists.
2022-12-15 10:04:59 -05:00
Raymond Hill
a91781a495
Rewrite logger's "exceptor" feature
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1861

The "exceptor" feature has been rewritten, with the following
changes as a result:

- The excepted filters cease to exist when closing the logger
- It's now possible to temporary except network filters

When toggling on/off a temporary exception, filter lists are now
fully reloaded. This simplified managing temporary exceptions, and
made it easy to implement temporary exception for network filters,
but this also means there might be a perceptible delay when
adding/removing temporary exceptions. At this point I consider
this an acceptable side-effect just to bring the ability to easily
create temporary exception for network filters, while this
simplified the existing temporary exception code throughout.
2022-12-14 16:04:45 -05:00
Raymond Hill
feaa338678
Code maintenance: replace uDom.js with dom.js
`uDom` is old and crusty and `dom` is meant as replacement. The
goal of `dom` is to be simpler and mainly just convenience
methods for handling the DOM with vanilla JS -- this is not a
framework.

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

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

Will fine-tune as per feedback.

Issues with the classic popup panel will not be addressed,
and if feedback is that it has become unusuable, it will be
outright removed.
2022-02-02 15:40:47 -05:00
Manish Jethani
d959c7aabe
Remove globals.js (#3849) 2021-08-23 10:54:16 -04:00
Raymond Hill
22022f636f
Modularize codebase with export/import
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1664

The changes are enough to fulfill the related issue.

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

    ./tools/make-nodejs

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

From the root of the package, you can try:

    node test

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

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

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

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

This commit requires the minimum supported version for
Chromium and Firefox be raised to 61 and 60 respectively.
2021-07-27 17:26:04 -04:00
Raymond Hill
e983f9a76e
Disable creation of cosmetic filters in picker when unenforceable
Related issue:
- https://github.com/gorhill/uBlock/issues/3212

The element picker will now properly work on sites where
cosmetic filtering is disabled, but will not allow the
creation of cosmetic filters when specific cosmetic filters
are not meant to be enforced in the current page.

When specific cosmetic filters are not meant to be enforced,
the element picker will still allow the creation of network
filters, that is unless the current page is trusted, in which
case using the element picker is pointless.
2021-07-12 11:55:58 -04:00
Raymond Hill
ad15a5dd51
Map csp_report to other
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1622
2021-06-24 08:09:18 -04: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
13f6bdae37
Improve representation of modifier filters in logger
As per feedback from filter list maintainers.
2020-11-20 07:14:02 -05:00