1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00
Commit Graph

1086 Commits

Author SHA1 Message Date
Raymond Hill
a51130baed
Remove unused scriptlets 2023-03-24 18:46:39 -04:00
Raymond Hill
18a84d2819
Refactor scriptlets injection code
Builtin scriptlets are no longer parsed as text-based resources,
they are imported as JS functions, and `toString()` is used to
obtain text-based representation of a scriptlet.

Scriptlet parameters are now passed as function call arguments
rather than by replacing text-based occurrences of `{{i}}`. The
arguments are always string values (see below for exception).

Support for argument as Object has been added. This opens the
door to have scriptlets using named arguments rather than
positional arguments, and hence easier to extend functionality
of existing scriptlets. Example:

    example.com##+js(scriplet, { "prop": "adblock", "value": false, "log": true })

Compatibility with user-provided scriptlets has been preserved.

User-provided scriptlets can benefit some of the changes:

Use the form `function(..){..}` instead of `(function(..){..})();`
in order to received scriptlet arguments as part of function call
-- instead of using `{{i}}`.

If using the form `function(..){..}`, you can choose to receive
an Object as argument -- just be sure that your scriptlet's
parameter is valid JSON notation.
2023-03-24 14:05:18 -04:00
Raymond Hill
285ce54d9c
Add regional filter list for Croatia/Serbia
Related discussion:
- https://github.com/uBlockOrigin/uAssets/issues/17088#issuecomment-1460942565
2023-03-21 09:56:43 -04:00
Raymond Hill
e93117cbb6
Add call-nothrow scriptlet
The purpose is to prevent a call to an existing function from
throwing an exception. The exception will be caught by the
scriptlet and neutralized.

The first argument must be a reference to a function call. At
the moment, the function call must exist at the time the
scriptlet is called.
2023-03-14 18:50:01 -04:00
Raymond Hill
5fe0416001
Fix https://github.com/uBlockOrigin/uBlock-issues/issues/2546 2023-03-14 14:05:20 -04:00
Raymond Hill
fc84fdee52
Fine tune scriptlet 2023-03-14 08:21:22 -04:00
Raymond Hill
b3821e6869
Support removing whole lines of text with regex in m3u-prune scriptlet
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2508

If the first argument is a regex with multine flag set, the
scriptlet will execute the regex against the whole text, and
remove matching text from the whole text.

If the matching text does not contains whole lines, the text
won't be removed, i.e. it is not allowed to remove only part
of a line.
2023-03-12 17:45:02 -04:00
Raymond Hill
f80c84ab40
Remove references to deprecated gitcdn.link
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2136#issuecomment-1465231197
2023-03-12 14:09:44 -04:00
Raymond Hill
4b4ef6a60c
Rename href-from-text to href-sanitizer, add argument
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2531#issuecomment-1462389539

Usage:
- example.com##+js(href-sanitizer, a[href^="/go?to="]:not([title]))
- example.com##+js(href-sanitizer, a[href^="/go?to="][title], [title])

The second argument is the attribute from which to extract the text
to be used for the `href` attribute of the link. If the second
attribute is absent, the text content of the element will be used.
2023-03-09 13:37:06 -05:00
Raymond Hill
e123256eaf
Add experimental href-from-text scriptlet
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2531

Usage:

    example.com##+js(href-from-text, a[href^="/tracker-link?to="]

The above scriptlet will find all elements matching the selector
passed as 1st argument, and replace the `href` attribute with the
text content of the element, if all the following conditions are
met:

- The element is a link (`a`) element
- The link element has an existing `href` attribute
- The text content of the element is a valid `https`-based URL
2023-03-09 08:49:26 -05:00
Raymond Hill
088e90ed42
Add list for Macedonia; add languages to Persian list
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2522
- https://github.com/AdguardTeam/AdguardFilters/pull/144318#issuecomment-1451721914
2023-03-02 17:09:32 -05:00
Raymond Hill
46c1eb8678
Update URLs to EasyDutch list
Related feedback:
- https://github.com/uBlockOrigin/uAssets/issues/11204#issuecomment-1384238094
2023-01-23 20:04:01 -05:00
Raymond Hill
98c0bd8406
Remove AdGuard Tracking Protection from stock lists
Related issue:
- https://github.com/AdguardTeam/AdguardFilters/issues/139081#issuecomment-1375396423
2023-01-11 20:29:07 -05:00
Raymond Hill
eb88e6fb12
Fix bad JSON 2022-12-26 09:11:04 -05:00
Raymond Hill
8f66de67e1
Remove gitcdn.link as CDN provider
Appears broken at the moment. Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1165#issuecomment-1364607559
2022-12-25 07:40:13 -05:00
Raymond Hill
c88f4445d1
Update invalid SDN URL for EasyList Lithuania
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2420
- https://github.com/uBlockOrigin/uBlock-issues/issues/1566#issuecomment-826372745
2022-12-22 10:34:49 -05:00
Raymond Hill
6140e55589
Remove combinatronics.io as CDN 2022-12-02 11:39:32 -05:00
Raymond Hill
17590c5a0c
Use git clone instead of submodule to pull uAssets dependencies
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2358

We need two different branches of uAssets to properly add the
default filter lists into the packages. I couldn't figure out
how to do this with submodules, using simple `git clone` as a
dependency just work.
2022-11-14 09:50:53 -05:00
Raymond Hill
2f646dbdb0
Pull reference Easylist assests from own repo 2022-10-24 12:37:04 -04:00
Raymond Hill
e84b374279
Partially revert fd945f3358 2022-10-19 18:17:39 -04:00
Raymond Hill
83b9ca5db6
Don't use github as cdn for EasyList/EasyPrivacy 2022-10-17 17:21:01 -04:00
Raymond Hill
fd945f3358
Add mirrors for EasyList lists 2022-10-05 10:37:33 -04:00
Raymond Hill
ec83127f6c
Update m3u-prune scriptlet 2022-09-26 22:37:11 -04:00
Raymond Hill
115f7bb687
Fix operator token-to-ctor map
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2294
2022-09-26 22:27:50 -04:00
Raymond Hill
6828e1c3b2
Bail out early if missing required argument 2022-09-25 06:57:51 -04:00
Raymond Hill
596145ceb9
Harden xml-prune scriptlet 2022-09-25 06:49:41 -04:00
Raymond Hill
bf690145c4
Add new scriptlet: xml-prune
Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/14849

Arguments:

1. Required. The selector of elements which are to be removed.
   Example: Period[id*="-roll-"][id*="-ad-"]

2. An optional selector that must have a match in the document
   for the pruning to occur. No selector means the pruning can
   be performed regardless.

3. An optional URL which must be a match for the pruning to
   occur. If left blank, the pruning can be performed regardless.
2022-09-24 20:49:00 -04:00
Raymond Hill
fe21ce5002
Ease load on EasyList server
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2276#issuecomment-1254387437
2022-09-22 05:52:47 -04:00
Imre Kristoffer Eilertsen
3ea8142d9e
Adding "LKA" for Sri Lanka and "NPL" for Nepal to IndianList's title (#3866)
* Added "LKA" for Sri Lanka to IndianList's title

* Added NPL for Nepal too

After seeing that IndianList already supports Nepal languages outright.
2022-09-18 07:17:45 -04:00
Raymond Hill
65a0561072
Slightly change behavior of window-close-if scriplet
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2270

If the argument to the window-close-if scriptlet is a regex, the
match will be against the whole location URL, otherwise the
match will be against the part+query part of the location URL.
2022-09-17 12:46:42 -04:00
Raymond Hill
424797a0b1
Fix/add support URLs for uBO's own lists 2022-09-14 09:29:49 -04:00
Raymond Hill
78fccadaf2
Fix bad alias
Related feedback:
- https://github.com/DandelionSprout/adfilt/issues/63#issuecomment-1214131551
2022-08-13 09:09:36 -04:00
Raymond Hill
ac0cdf2d56
Update URL of new RUAdList location
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2193
2022-08-01 17:53:02 -04:00
Raymond Hill
cb65b2a122
Update URLs for Latvian (LVA-0) list
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2176
2022-07-17 12:59:23 -04:00
Raymond Hill
9d81b7c4d9
Skip testing context when none present in acis scriptlet
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2154
2022-06-24 13:35:20 -04:00
Raymond Hill
dddf353c94
Use hard tab 2022-06-19 11:55:06 -04:00
Raymond Hill
33b839fdd0
Replace Adblock-Iran with PersianBlocker
Related discussion:
- https://github.com/uBlockOrigin/uAssets/discussions/13259
2022-06-05 09:17:41 -04:00
Ming Di Leom
2ce7f84157
fix(curben-filter): curben.gitlab.io migrated to malware-filter.gitlab.io (#3867) 2022-06-03 12:46:10 -04:00
Raymond Hill
fd3ff0b395
Fix bad content URL for List-KR
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2129

Fixed as suggested in:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2129#issuecomment-1142168643
2022-06-03 12:31:07 -04:00
Raymond Hill
b76d7c6af6
Also dispatch loadend event in case of match
Related issue:
- https://github.com/AdguardTeam/Scriptlets/issues/199
2022-05-08 11:22:32 -04:00
Raymond Hill
bd1e82418b
Update CDN URLs: gitcdn.xyz/repo => gitcdn.link/cdn 2022-05-02 12:42:20 -04:00
Raymond Hill
792ef1186d
Update content URLs for List-KR 2022-04-25 13:52:11 -04:00
Raymond Hill
ed0f7ae3ce
Replace Youslist with List-KR
As per internal discussion with volunteer filter list maintainers.
2022-04-25 12:06:37 -04:00
Raymond Hill
3af9cd2b71
Add CDN URLs to NLD list
Related discussion:
- https://github.com/uBlockOrigin/uAssets/issues/11204#issuecomment-1104098368
2022-04-20 12:42:49 -04:00
Raymond Hill
09666fd6d2
Update NLD content URL as requested
Related feedback:
- https://github.com/uBlockOrigin/uAssets/issues/11204#issuecomment-1099192585
2022-04-14 10:29:40 -04:00
Raymond Hill
1091c204b6
Add IndianList as regional list
As discussed with contributors.
2022-04-09 10:08:13 -04:00
Raymond Hill
a1788e64bc
Need local URL to enabled-by-default quick-fixes list
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2022
2022-04-06 12:46:17 -04:00
Raymond Hill
c955c2b974
Actually, prefer uAssetsCDN over uAssets for mirrors 2022-03-24 14:08:14 -04:00
Raymond Hill
0bfa41ceb9
Update CDN links to gh-pages repo 2022-03-24 12:58:54 -04:00
Raymond Hill
3c52e75863
Set reference list URL to deployed gh-pages 2022-03-23 12:08:28 -04:00