1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-06 02:42:33 +01:00
Commit Graph

970 Commits

Author SHA1 Message Date
Raymond Hill
5fa873960f
Listen to load events on window, not document
Related feedback:
- 0f330c7359 (r45774155)
2021-01-08 13:11:09 -05:00
Raymond Hill
0f330c7359
Add ability to linger for remove-attr scriplet
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1445

A third (optional) argument has been added to `remove-attr`
scriptlet, which can be one or more space-separated tokens
dictating the behavior of the scriptlet:

`stay`: This tells the scriplet to stay and act on DOM
changes, whiĺe the default behavior is to act only once
when the document becomes interactive.

`complete`: This tells the scriplet to start acting only
when the document is complete, i.e. once all secondary
resources have been loaded, while the default is to start
acting when the document is interactive -- which is earlier
than when the document is complete.

Example:

    ...##+js(remove-attr, class, .j-mini-player, stay)
2021-01-08 10:45:35 -05:00
Raymond Hill
ab06a01062
Better handle Request argument in no-fetch-if
As per internal feedback.
2020-12-24 08:26:30 -05:00
Raymond Hill
b6ed83bc5c
Add logging ability to new scriptlet no-fetch-if
When no-fetch-if scriptlet is used without argument, the
parameters passed to no-fetch-if will be output to the
console, as `uBO: fetch([...list of arguments...])`.
2020-12-11 09:28:29 -05:00
Raymond Hill
ba11a70013
Add new scriptlet: no-fetch-if
The new scriptlet allows to defuse calls to fetch() by returning
a promise which always resolve to an empty response.

There is only one argument, which is a space-separated list
of conditions which must be ALL fulfilled in order for the
defusing to take place.

Each condition is a pair of property name and property value
separated by a column. Valid property names are those
documented as valid `init` options:

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch

The URL of the fetch() is a special case and does not have to
be associated with a property name. Example of usage:

  ...##+js(no-fetch-if, method:HEAD)

Which means: defuse the call to fetch() if there is an
explicit option which contains `HEAD`. Another example:

  ...##+js(no-fetch-if, adsbygoogle.js)

Which means: defuse the call to fetch() if the URL contains
`adsbygoogle.js`. Multiple conditions can be provided:

  ...##+js(no-fetch-if, adsbygoogle.js method:HEAD)

If at least one condition does not match, the defusing will
not take place.

The string against which to match can be a literal regular
expression:

  ...##+js(no-fetch-if, /adsbygoogle.js$/ method:/HEAD|POST/)

Additonally, the following deprecated scriplets have been
removed:

- requestAnimationFrame-if.js
- setInterval-defuser.js
- setTimeout-logger.js
2020-12-11 08:29:23 -05:00
Raymond Hill
bf7ce857ee
Update URL of HUN filter list
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1364
2020-11-27 11:36:50 -05:00
Raymond Hill
13f92756be
Make json-prune scriptlet also trap Response.json() calls
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/jns1t4/white_screen_skip_ad_on_youtube/gbg4aq8/
2020-11-08 08:45:33 -05:00
Raymond Hill
fe2c4a4914
Use secure.fanboy.co.nz instead of fanboy.co.nz
Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/8166
2020-11-06 06:22:34 -05:00
Raymond Hill
d037d9dced
Update Fanboy URLs
Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/8166
2020-11-06 06:17:37 -05:00
Raymond Hill
5de0ce9757
Improve fix for set-constant conflict
Related commit:
- 2546f39568
2020-10-20 05:23:10 -04:00
Raymond Hill
2546f39568
Avoid trapping already trapped properties
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/156#issuecomment-712249945

When the client code assigned a variable to itself, this
would cause the scriptlet to try to re-trap already
trapped properties.
2020-10-19 12:01:55 -04:00
Raymond Hill
a08f33e09d
Prevent only target (leaf) property from being overtaken
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/156#issuecomment-707095193

Related commit:
- 6e010ecc0f
2020-10-12 11:00:30 -04:00
Raymond Hill
6e010ecc0f
Prevent set-constant properties from being overtaken
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/156#issuecomment-707095193

Additionally, while investigating the issue I removed
code which is no longer needed since content scripts
are now injected in `about:blank` frames since 1.29.0.
2020-10-12 10:08:51 -04:00
Raymond Hill
11b9f88b38
Update urlhaus-filter URL
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1285
2020-10-08 07:25:15 -04:00
pixeltris
75c58ec7af
Update for twitch.tv #5184 (#3781) 2020-10-02 12:20:30 -04:00
Raymond Hill
3693755e94
Add fall back URL for manual update of urlhaus-filter
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/j1ehm5/
2020-09-28 16:31:44 -04:00
Raymond Hill
793e2c7896
Further fine tune new aost scriptlet 2020-09-23 09:41:00 -04:00
Raymond Hill
365b3f7f83
Changes to abort-on-stack-trace as per road testing
Related commit:
- https://github.com/gorhill/uBlock/commit/b735ac6b6aba
2020-09-23 06:54:44 -04:00
Raymond Hill
1e91fb8733
Fine tune regex used to detect inline script contexts
Related commit:
- b735ac6b6a
2020-09-22 11:18:12 -04:00
Raymond Hill
b735ac6b6a
Add abort-on-stack-trace scriptlet
This new scriplet has become necessary as a
countermeasure to new bypass mechanisms by
some websites, as discussed with filter list
maintainers.

Also related discussion:
https://github.com/AdguardTeam/Scriptlets/issues/82

Scriptlet: abort-on-stack-trace

Alias: aost

Argument 1:
  The property to trap in order to launch the
  stack trace matching code, ex. Math.random

Argument 2:
  The string (needle) to match against the stack
  trace. If the empty string, always match. There
  is a special string which can be used to match
  inline script context, <inline-script>.

Argument 3:
Whether to log, and if so how:
  Empty string: do not log
  1: log stack trace for all access to trapped
     property
  2: log stack trace for defused access to trapped
     property
  3: log stack trace for non-defused access to
     trapped property
2020-09-22 09:59:04 -04:00
Raymond Hill
953ba1231f
Object.values() may fail for unknown reasons
Work around this issue by using more reliable
Object.keys().
2020-09-11 08:30:11 -04:00
Raymond Hill
23f08f0274
Add support for blocklist of filter lists
Many filter lists are known to cause serious filtering
issues in uBO and are not meant to be used in uBO.

Unfortunately, unwitting users keep importing these
filter lists and as a result this ends up causing
filtering issues for which the resolution is always
to remove the incompatible filter list.

Example of inconpatible filter lists:
- Reek's Anti-Adblock Killer
- AdBlock Warning Removal List
- ABP anti-circumvention filter list

uBO will use the following resource to know
which filter lists are incompatible:
- https://github.com/uBlockOrigin/uAssets/blob/master/filters/badlists.txt

Incompatible filter lists can still be imported into
uBO, useful for asset-viewing purpose, but their content
will be discarded at compile time.
2020-08-21 11:57:20 -04:00
Raymond Hill
8275690e93
Fix https://github.com/uBlockOrigin/uAssets/issues/5696#issuecomment-675757755 2020-08-20 09:53:11 -04:00
Raymond Hill
bf01fc737d
urlhaus blocklist CDNs: remove githack, add github, gitlab 2020-07-20 12:52:41 -04:00
Raymond Hill
c33de41660
Support multiple trappers to same property in set-constant
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/156
- https://github.com/uBlockOrigin/uBlock-issues/issues/1162

Take into account that a trapped property may have been
already trapped, and if so honour previous trapper
getter/setter.
2020-07-19 08:16:40 -04:00
Raymond Hill
321eae7417
Remove stray empty line 2020-07-16 16:39:07 -04:00
Raymond Hill
3aed2497a3
Use AdGuard French as in-place replacement of Liste FR
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/379

Related recent discussion:
- 529643bdce
2020-07-16 16:29:24 -04:00
Raymond Hill
975d894419
Stringify argument using implicit rather than explicit conversion
Reported internally by team.

Explicit conversion was causing an exception to be
thrown when the type argument was not supporting
`toString()`, for example when `type` argument was
literal `null`.
2020-07-16 09:55:06 -04:00
Raymond Hill
947651427d
Use tabs instead of whitespaces 2020-07-15 16:06:39 -04:00
Raymond Hill
dacf83b5c0
Add cdn.jsdelivr.net mirror for urlhaus blocklist 2020-07-13 15:50:13 -04:00
Raymond Hill
d93f32e882
Remove repo.or.cz from list of CDNs for urlhaus blocklist
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1152
2020-07-13 15:34:07 -04:00
Raymond Hill
4197defe6e
Remove reference to no longer used resources.txt 2020-07-08 10:51:26 -04:00
Raymond Hill
4c89c16401
Fix cdn.statically.io-based URL for urlhaus lists
Related feedback:
- a13ac92089 (commitcomment-40399574)
2020-07-06 11:06:59 -04:00
Raymond Hill
46e205d61a
Fix incorrect list name for newly added urlhaus list 2020-07-06 09:43:44 -04:00
Raymond Hill
a13ac92089
Replace seemingly abandoned malware lists with urlhaus list
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1116
- https://github.com/uBlockOrigin/uBlock-issues/issues/984

It has been found that the two malware lists uBO uses by
default appear to be essentially no longer maintained.

urlhaus list[1] has been identified by the community as
being well maintained and as being actually useful as a
default malware-related list in uBO, since it's being updated
every day from a database of top domains and specific URLs
identified as serving malicious content. Additionally, the
maintainer of urlhaus list has taken steps to increase
compatibility with uBO[2].

The decision has been to replace the current two malware-
related lists with urlhaus list, which will be enabled by
default in uBO -- and this means that list will be part of
uBO's package from now on.

For those who have the two removed malware lists enabled,
these will be moved to the custom lists section -- they
will still be enabled. It is suggested users remove them from
their selection of lists as their usefulness at this point
is questionable.

[1] https://gitlab.com/curben/urlhaus-filter
[2] 859dfd03c6
2020-07-06 09:03:20 -04:00
Raymond Hill
8f3d8cde7a
Add support to compare delay against literal Number.NaN in nossif/nostif
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1136
2020-07-02 11:47:49 -04:00
Raymond Hill
f433932d86
Add support for wildcard/array in json-prune
Add support for specially-named properties:

`[]`, to iterate through all elements in an array, in
order to deal more graciously with cases where the
property to remove is an element in an array. An
actual case:

    +js(json-prune, playlist.movies.0.adserver playlist.movies.1.adserver ...)

Can be now converted to:

    +js(json-prune, playlist.movies.[].adserver)

`*`, to iterate through all own properties of an object,
in order to deal with random-named properties. For
example (not an actual case):

    +js(json-prune, playlist.*.adserver)

Where `adserver` would be a property member of an
object which is itself a property of `playlist`, but
which name is unknown or is variable.
2020-06-26 10:03:48 -04:00
Raymond Hill
c4d39d3763
Fix cookie removal on subdomains of base domain
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1126
2020-06-24 17:18:14 -04:00
Raymond Hill
89fcdc6a11
Update URL for EasyList Lithuania
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1106
2020-06-10 16:28:31 -04:00
Raymond Hill
faffb63234
easylist.to server is fixed, revert a79e0c8f40 2020-05-26 08:14:08 -04:00
Raymond Hill
a79e0c8f40
Use secure.fanboy.co.nz/easylist.txt for the time being
Related discussion:
- https://twitter.com/gorhill/status/1264689513475039232
2020-05-25 07:32:02 -04:00
Raymond Hill
5227013a8e
Add uBO: prefix to logged output in some scriptlets
As per request.
2020-04-28 11:19:26 -04:00
Raymond Hill
578594bbd7
Improve logging capabilities of json-prune scriptlet
Specifically:

- Log entries as received by client code
- Prettier and more readable console output
- Ability to only log entries matching a
  specific needle

As per internal discussion at
<https://github.com/uBlockOrigin/uAssets>; limited
logging capabilities of json-prune originally raised
by <https://github.com/gwarser>.
2020-04-28 09:47:03 -04:00
Raymond Hill
a733944624
Add statically.io as CDN provider
As of commit time, the provider caches resources
for at most 24 hours.
2020-04-26 09:59:51 -04:00
Raymond Hill
d95b27915f
Bring fingerprint2.js scriptlet up to date
Related issue:
- https://github.com/uBlockOrigin/uAssets/pull/4961
2020-04-18 09:45:07 -04:00
Raymond Hill
08be3a0558
Add CDN URLs for "uBlock filters -- Unbreak" 2020-04-16 09:03:29 -04:00
Raymond Hill
1de0e820b8
Replace requestAnimationFrame-if.js with no-requestAnimationFrame-if.js
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/981

To be consistent with no-setTimeout-if.js.

requestAnimationFrame-if.js is deprecated and must no longer be
used, it will be removed in the near future when it's no longer
in use in default filter lists.

no-requestAnimationFrame-if.js is aliased to norafif.js.
2020-04-15 10:06:53 -04:00
Raymond Hill
bf2d38ccf3
Add CDN URLS for ublock-filters
Related commit:
- 4687c60bf9
2020-04-08 10:12:50 -04:00
Raymond Hill
34a2ef6c42
Remove Disconnect Malvertising from stock filter lists
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/973

The list appears no longer maintained and has seen mostly
only removed entries over years.
2020-04-05 08:24:05 -04:00
Raymond Hill
81413b4076
Remove hpHosts from stock filter lists
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/971
2020-04-01 07:41:52 -04:00