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

Rules for blocking cookies #83

Closed
WeetchKing opened this issue Mar 15, 2014 · 5 comments
Closed

Rules for blocking cookies #83

WeetchKing opened this issue Mar 15, 2014 · 5 comments

Comments

@WeetchKing
Copy link

Is there anyway I can block cookies using rules instead of adding them manually?

Something like this:

cookie domain:
example.com

cookie name:
example_posts_*

action:
block

@fcapano
Copy link
Member

fcapano commented Mar 15, 2014

In the extension's options go to Blocked cookies and then click on "+ Block cookie" on the upper right. Enter the filters (leave empy if a field does not have to be filtered) and click on the tick. If I remember correctly, you can use wildcards, so "example_posts_*" should work. ;)
Please let me know if it works correctly since I wrote that part of the extension so much time ago and I hardly ever use it.

@WeetchKing
Copy link
Author

Not working, I add it with the wildcard but I still get the cookie when entering the page

@fcapano
Copy link
Member

fcapano commented Mar 15, 2014

Ok, thanks for reporting. I'll look into it

@chrissearle
Copy link
Contributor

Looks like filterMatchesCookie needs attention for this:

function filterMatchesCookie(rule, name, domain, value){
    var ruleDomainReg = new RegExp(rule.domain);
    if(rule.domain!=undefined && domain.match(ruleDomainReg) == null){
        return false
    }
    if(rule.name!=undefined && name!=rule.name){
        return false
    }
    if(rule.value!=undefined && value!=rule.value){
        return false
    }
    return true
}

So - regex on domain works but not on name.

As far as I can tell - this is being called from background.js (about line 99) when checking for blocked.

I could really do with this too - I have a site I use that appends a changing ID to two different cookies that I'd like to block.

@djbclark
Copy link

djbclark commented Jul 26, 2017

So it looks like this is fixed in the code up at:

https://github.com/fcapano/Edit-This-Cookie/blob/a171de3d3d3dfce66852172ecaf3be711de2c7c9/js/utils.js#L109

But not in the version 1.4.1 (ID: fngmhnnpilhplaeedifhccceomclgfbg) as is installed as of Wed, Jul 26, 2017 via chrome. It looks like for some reason the version available via chrome hasn't been updated since September 28, 2014 so this makes sense.

I tried just cut-and-pasting just the new function but that didn't work.

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

No branches or pull requests

4 participants