uBlockOrigin / uBOL-home

uBO Lite home (MV3)
GNU General Public License v3.0
1.22k stars 50 forks source link

Pre-enabled rulesets in manifest.json are being disabled by `defaultRulesetsFromLanguage` #143

Closed m3nadav closed 2 weeks ago

m3nadav commented 4 months ago

During the installation of the extension, the defaultRulesetsFromLanguage function uses a hard-coded out containing the default ruleset only (on ruleset-manager.js:437) so any enabled ruleset from the manifest.json that is not "default" and the language default is being disabled during installation

To fix this, that line should be

const out = await dnr.getEnabledRulesets();

I will open a PR on this repo hoping that's the way to contribute to this version of uBO 🙏

gorhill commented 4 months ago

There is only one enabled ruleset by default, the default one.


Also, the source code in uBOL is generated from a build script at https://github.com/gorhill/uBlock/tree/master/platform/mv3, so any change in the code needs to be done there. But as said there is only one ruleset enabled by default -- I don't plan to change this.

m3nadav commented 4 months ago

Is there another way to control what lists are enabled that is not through the extension UI?

m3nadav commented 4 months ago

I just noticed I haven't given any context - I'd like to manually install the extension on multiple browsers and enable specific lists as part of the installation

The PR I opened just to manually control the enabled lists using the manifest.json file, but doesn't change the current defaults

m3nadav commented 4 months ago

@gorhill I'd appreciate your comment on this I can't open a PR to the main repository as it is limited for users that have contributed to that repository in the past The change I propose does not change the default filter lists, it just uses the already declared defaults as input during the installation process, as can be seen here:

image

Appreciate your work, and hope to be able to contribute to it

sissbruecker commented 1 month ago

I'm using uBOL in an automated / headless scenario, where users never get to interact with the browser UI and thus can not modify the rulesets. I'd also like to be able to configure the default rulesets through manifest.json, or some other mechanism if patching manifest.json is not appropriate.

m3nadav commented 1 month ago

@sissbruecker sadly the fix PR was declined a few days ago without any comment or reference so I'm not sure why

gorhill commented 2 weeks ago

Fixed with https://github.com/gorhill/uBlock/commit/2782b16ecf4e25414ca1b27a144535676a764740.