diff --git a/Resources-Library.md b/Resources-Library.md index 7e41ca2..1366a0f 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -1294,20 +1294,22 @@ Also see: New in [1.47.5b4](https://github.com/gorhill/uBlock/commit/e123256eaf64be19f81eba123970db07b45eb0ae) +Set the `href` attribute to a value found in the DOM at, or below the targeted `a` element, and optionally with transformation steps. + Parameters: - - required, a CSS selector which matches the elements for which the scriptlet should replace the `href` attribute with the text content of the element, if ALL the following conditions are met: + - required, A plain CSS selector for elements which `href` property must be sanitized, if ALL the following conditions are met: - The element is a link (``) element - The link element has an existing `href` attribute - The text content of the element is a valid `https`-based URL - - optional, the attribute from which to extract the text to be used for the `href` attribute of the link, otherwise the text content of the element will be used. - - If the second parameter starts with `?`, the scriptlet will look up the value of the search parameter which name is what comes after the `?`. (New in [1.49.3rc15](https://github.com/gorhill/uBlock/commit/56e1d92dbd65e6168620053b1fec4c21c03d664e)). Supports ability to recursively unwrap search parameters. [1.58.1rc11](https://github.com/gorhill/uBlock/commit/84be9cde6d) + - optional, one or more tokens to lookup the source of the `href` property, and optionally the transformation steps to perform, otherwise the text content of the element will be used. + - `[name]`: Use the value of the attribute `name` as the URL + - `?name`: Use the value of the `href` query parameter `name` [1.49.3rc15](https://github.com/gorhill/uBlock/commit/56e1d92dbd65e6168620053b1fec4c21c03d664e). Supports unwrapping query parameters recursively [1.58.1rc11](https://github.com/gorhill/uBlock/commit/84be9cde6d) + - Transformation steps: see [`urlskip`](../Static-filter-syntax#urlskip) documentation [1.61.3b10](https://github.com/gorhill/uBlock/commit/9bf8d53ebe7cab20ac8491741c5b99cf9d35d643) Examples: - `vk.com##+js(href-sanitizer, a[href^="/go?to="][title], [title])` - `vk.com##+js(href-sanitizer, a[href^="/away.php?to="][title], ?to)` - - `Text`: - `mozilla.org##+js(href-sanitizer, a[href^="https://app.adjust.com/"][href*="?redirect="], ?redirect)` - - `example.com##+js(href-sanitizer, a.clickTracker, ?r?u)` + - `example.org##+js(href-sanitizer, a[href*="/redirect"], ?url ?url -base64)` Solves [Anti-redirect scriptlet for vk.com (href-sanitizer)](https://github.com/uBlockOrigin/uBlock-issues/issues/2531). @@ -1600,7 +1602,8 @@ Parameters: - `ok`, - `on`1 / `off`1, - `true` / `t`3 / `false` / `f`3, - - `yes` / `y` / `no` / `n` + - `yes` / `y` / `no` / `n`, + - `all`10 / `none`10 / `functional`10 - optional, cookie path, defaults to /; possible values: - `/`: root path - `none`: to set no path at all @@ -1614,6 +1617,7 @@ Parameters: 7. [1.58.1rc0](https://github.com/gorhill/uBlock/commit/37d31a82d8) 8. [1.59.1b5](https://github.com/gorhill/uBlock/commit/3e2171f550) 9. [1.60.1b12](https://github.com/gorhill/uBlock/commit/4d982d9972be4eb0a23e289c6f3ec3ae8cca36f2) +10. [1.61.3b10](https://github.com/gorhill/uBlock/commit/791a2b08e1a15c169c0a86130de769822628c81d) The scriptlet encodes cookie names and values, e.g value "{ test: 'value'}" becomes `%7B%20test%3A%20'value'%7D`.