Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Privileged third-party filters list registration #331

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

DandelionSprout
Copy link

As per NanoAdblocker/NanoCore#266. I suppose I'll be fine with moving this list over to your repo. After all, I didn't intend to update it more than once every few months or so anyway (The IDCAC extension updates its version of these entries monthly-ish).

@jspenguin2017
Copy link
Member

Please provide the following, they are for the assets manifest.

  • Display name / title (keep it short, like the other filters)
  • Homepage URL
  • Support URL

@jspenguin2017 jspenguin2017 changed the title Adding a third-party list to this repo Privileged third-party filter registration May 15, 2019
@jspenguin2017 jspenguin2017 changed the title Privileged third-party filter registration Privileged third-party filters list registration May 15, 2019
@jspenguin2017 jspenguin2017 self-assigned this May 15, 2019
@DandelionSprout
Copy link
Author

I've tried to provide those things now.

@jspenguin2017
Copy link
Member

Hum... The home page should be your homepage / homepage you created for your filter. Same for support URL.

@jspenguin2017
Copy link
Member

Also note that privileged script snippets will not work at all in uBO.

@DandelionSprout
Copy link
Author

Some testing I did in uBO an hour ago indicated that it somehow does in fact support privileged scripts when NanoResources.txt is used in it.
image

I've updated the homepage/support URLs again now.

@DandelionSprout
Copy link
Author

In case you want to do small bits of polish on this pull request yourself, I have ensured that the Allow edits from maintainers button is turned on for you to be able to do so. 🙂

@DandelionSprout
Copy link
Author

DandelionSprout commented May 15, 2019

I've now tested privileged filters in uBO in Vivaldi, Chromium (the base version), Firefox for Windows, and Pale Moon, and ##+js(nanop-easy-set-cookie.js, entries were registered in the uBO logger in all four browsers as long as userResourcesLocation https://raw.githubusercontent.com/NanoAdblocker/NanoFilters/master/NanoFilters/NanoResources.txt was used, and it had functional effect in removing the cookie banner on Twitter even without the main IDCAC list.

I understand it as such that you have deep respect and a slight fear for what privileged filter entries can do; but in my eyes this is in fact great news, as it helps those who for whichever reason still want to use uBO to achieve functionality parity with Nano Adblocker. I didn't even feel it deserved a separate issue report, because in my eyes there's not much about it that needs to be fixed.

@DandelionSprout
Copy link
Author

The comment immediately above should hereby be disregarded, after I did a little bit more cross-comparison testing between Nano and uBO in Firefox. Indeed the scripts doesn't seem to work very well (if at all) in uBO after all. More details at DandelionSprout/adfilt#7 (comment).

@jspenguin2017
Copy link
Member

Yes, as gwarser noted, privileged script snippets will abort if the host is uBO. This is important as uBO does not know how to stop unprivileged filters from using privileged resources.

@jspenguin2017
Copy link
Member

Alright, one last thing, what is the license of this filter? Is the original extension open source? Where is the source code hosted?

@DandelionSprout
Copy link
Author

DandelionSprout commented May 16, 2019

https://addons.mozilla.org/en-US/firefox/addon/i-dont-care-about-cookies/ says that IDCAC uses GPL v3, which is the same that is used by NanoFilters, so I presumed that it didn't need to be specifically pointed out inside the list.

However, despite being said to be GPLv3, it doesn't have a publicly available source code. Instead, one is apparently supposed to extract the source code from the extension, e.g. by extracting the .xpi as if it was a .zip file.

@jspenguin2017
Copy link
Member

I unzipped the package but I don't see a license file inside. The files in there don't have copyright / license headers neither. Also, there is one 300+ KiB file that consists of only one line, I'm not a lawyer but I'm pretty sure that's not allowed under GPL-3.0 if the package itself is used to distribute the source code.

This feels a bit sketchy, I'll need to investigate further...

@DandelionSprout
Copy link
Author

If you want to contact him about all this, he's available on E-mail at [email protected] and has a Facebook feed at https://www.i-dont-care-about-cookies.eu/#comments, and he tends to reply to them within a day.

https://addons.mozilla.org/en-US/firefox/addon/i-dont-care-about-cookies/reviews/1179215/ appears to implicate that he doesn't have an online source code for it at all, for that matter.

@DandelionSprout
Copy link
Author

DandelionSprout commented May 17, 2019

As I am on pretty good standing with him, I've now sent him an E-mail now where I've suggested that he could either 1) specify the licence somewhere inside the extension's files, 2) sync his source code to GitHub/GitLab and select GPL-3.0 for the repo, or 3) use a different licence.

So we'll see how fast he'll act on that E-mail and on those suggestions of mine. I know first-hand that licences are tricky to navigate through, so I feel fairly certain that he didn't mean any harm.

@jspenguin2017
Copy link
Member

jspenguin2017 commented May 19, 2019

I'm inclined to decline this request, for the following reasons:

  • This filter covers a fraction of what the original extension does
  • Users needs to subscribe to the main filter list separately
  • Licensing is unclear

@DandelionSprout
Copy link
Author

My intention with the list was that it'd help show off some of Nano Adblocker's unique capabilities, and in the process making what would essentially be only the 4th Nano-specific list ever made (after the three Nano Filters lists).

@DandelionSprout
Copy link
Author

Users needs to subscribe to the main filter list separately

As I've very recently become able to adapt and run basic Python scripts to fetch, replace and output list entries, I could potentially have made such a script to combine the official list with the Nano expansion. But since the script can currently only be run manually (that I'm aware of), it would have lagged behind the official list when it comes to official updates.

eneba.com##+js(nanop-easy-set-cookie.js, GDPR=1)
enviam.de##+js(nanop-easy-set-cookie.js, dws01-level=2)
esea.net##+js(nanop-easy-set-cookie.js, cookie_consent=1)
euroclear.com##+js(nanop-easy-set-cookie.js, cc_necessary=true', 'cc_functional=true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this generated? Your parser needs some work. You need two lines to inject two cookies.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't know that such a limitation applied to nanop-easy-set-cookie.js. I'll fix it in about half an hour; I just need to finish some sorting work on Pixiv first.

Copy link
Author

@DandelionSprout DandelionSprout May 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed it now. For the time being I'm converting the entries manually in Sublime Text, since there's relatively few of them.

@jspenguin2017
Copy link
Member

jspenguin2017 commented May 20, 2019

All script snippets are documented, including what they do and what arguments they accept.

# Set a cookie, 1 required arguments, 3 optional arguments.
# data - The key=value pair.
# path - Optional, the path, default to current path.
# domain - Optional, the domain, default to current domain.
# secure - true or false. Optional, default to false.
# del - true or false. Set to true to delete the cookie instead. Optional,
# default to false.

# Set a cookie the hard way, 1 required argument.
# data - The cookie data to set.

@jspenguin2017
Copy link
Member

jspenguin2017 commented May 20, 2019

Ideally we could implement a way for privileged filters to load external unprivileged subfilters, that should solve most of the problems we're facing here.

@DandelionSprout
Copy link
Author

Given all the restrictions that have been placed on the usage of !#include, both by the AdGuard team and by gorhill, that rules out the easiest way we could've done such a thing.

@jspenguin2017
Copy link
Member

jspenguin2017 commented May 20, 2019

Yes, we'll have to implement ourselves. I'm thinking !#nanop-include-absolute to bypass the restriction (only allowed in privileged filters), and !#nano-release-privilege to drop the privilege in the middle of the filter.

Not sure how easy it is, things can get complicated if the external subfilter tries to load its own subfilters.

@DandelionSprout
Copy link
Author

It appears that v3.0.2 of the IDCAC extension has added a LICENCE file to it now, so that's one less thing for you to need to be worried about regarding this list.
image

@jspenguin2017
Copy link
Member

Hum... I expected the license file to look differently.

@jspenguin2017
Copy link
Member

jspenguin2017 commented Jul 9, 2019

But OK, let's call that good enough. Updated the post above.

@hawkeye116477
Copy link

hawkeye116477 commented Aug 23, 2019

As I've very recently become able to adapt and run basic Python scripts to fetch, replace and output list entries, I could potentially have made such a script to combine the official list with the Nano expansion. But since the script can currently only be run manually (that I'm aware of), it would have lagged behind the official list when it comes to official updates.

PolishFiltersTeam has script for including external lists => https://github.com/PolishFiltersTeam/ScriptsPlayground/blob/master/scripts/VICHS.sh, you can pin some machine user like NanoMeow to CircleCI or something else (you will need to create token for GH push), then set cron daily/weekly and filterlists should be updated (IDAC doesn't have updates that often, so I think that maybe even twice a week should suffice). For now there is no documentation, but if you want to do that, then you can just ask me how to start 😄


However I see that some domains don't need clicking rules, @DandelionSprout can just use magic of :style() rules. For example:

www.pekao.com.pl##body.is-reveal-open:style(overflow: auto !important; width: unset !important;)
www.pekao.com.pl##.reveal-overlay:has(#gdpr-popup)

, it's in Polish GDPR-Cookies list.

@jspenguin2017
Copy link
Member

@hawkeye116477 That's not the issue here, I don't want to carry the main filter in my repo. Also, a 500 lines shell script is too overkill to concatenate 2 text files.

@krystian3w
Copy link

AdguardTeam/Scriptlets#23, maybe help AdGuard to create scriplets set-cookie?

@jspenguin2017
Copy link
Member

jspenguin2017 commented Sep 6, 2019

@krystian3w
I highly doubt they need help with implementing that, considering how to set cookies is pretty well documented on the Internet.

Either way, that has little to do with this Pull Request, let's not get off topic here.

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

Successfully merging this pull request may close these issues.

4 participants