Skip to content

Add $cookie modifier support #2926

@superlex

Description

@superlex

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT an issue with YouTube, Facebook or Twitch.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

As of now uBO doesn't support $cookie modifier:
https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#extended-syntax

It could be useful to prevent a cookie from being set:
AdguardTeam/AdguardFilters@236ee4d

According to AdGuard KB,

The $cookie modifier completely changes rule behavior. Instead of blocking a request, this modifier makes AdGuard suppress or modify the Cookie and Set-Cookie headers.

https://adguard.com/kb/it/general/ad-filtering/create-own-filters/#cookie-modifier

Original AG issue:
AdguardTeam/AdguardBrowserExtension#961

A specific URL where the issue occurs.

everywhere

Steps to Reproduce

Add to user filters list

example.org##+js(set-cookie, examplecookie , 1)
$cookie=examplecookie,domain=example.org

Expected behavior

examplecookie cookie isn't set.

Actual behavior

examplecookie cookie is set.

uBO version

1.53

Browser name and version

Firefox 119

Operating System and version

macOS 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions