Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $cookie modifier support #2926

Open
9 tasks done
superlex opened this issue Nov 3, 2023 · 5 comments
Open
9 tasks done

Add $cookie modifier support #2926

superlex opened this issue Nov 3, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@superlex
Copy link

superlex commented Nov 3, 2023

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

@MasterKia MasterKia added the enhancement New feature or request label Nov 3, 2023
@superlex superlex changed the title Add $cookie support Add $cookie modifier support Nov 4, 2023
@gorhill
Copy link
Member

gorhill commented Nov 4, 2023

I consider the best way to deal with such filter option is through the browser.cookies API, but adding such permissions would trigger a new extension permissions warning, leading to a lot of unhappy people. Implementing this through the webRequest API requires enabling a specific API capabilities, but it comes with a lot of warnings, including about performance concerns, see https://developer.chrome.com/docs/extensions/reference/webRequest/, search for opt_extraInfoSpec:

Specifying 'extraHeaders' in opt_extraInfoSpec may have a negative impact on performance, hence it should only be used when really necessary.

So I will keep the issue opened, but as of now it's unlikely I will go through with it.

Related issue: #2552

@iam-py-test
Copy link
Contributor

iam-py-test commented Nov 4, 2023

I consider the best way to deal with such filter option is through the browser.cookies API, but adding such permissions would trigger a new extension permissions warning, leading to a lot of unhappy people.

What about an optional permission and a setting, ie
image
Thanks

@superlex
Copy link
Author

superlex commented Nov 4, 2023

Thanks anyway :)

@superlex
Copy link
Author

@gorhill

Something like a scriptlet cookie-defuser / prevent-cookie ?

See mapx- workaround:
uBlockOrigin/uAssets@bc3b6b7

@ghost
Copy link

ghost commented Mar 27, 2024

What about an optional permission and a setting, ie image

The great majority of people would understand this as Allow uBlock Origin to block cookie notices/popups. The average user doesn't know what a cookie actually is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants