gorhill / uBlock

uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.
GNU General Public License v3.0
47.36k stars 3.15k forks source link

Possibility for comments in "My rules" #333

Closed Alpengreis closed 9 years ago

Alpengreis commented 9 years ago

As in uMatrix it would be good to have the possibility to make comments in "My rules" (with the # char).

gorhill commented 9 years ago

As in uMatrix

uMatrix does not support comments in rules.

Alpengreis commented 9 years ago

Ok, I read it from https://github.com/gorhill/uMatrix/wiki/Rules-syntax ... "The # character can be used for commenting, and for each line, the parser will ignore the first occurrence of # and everything following it."

Then I can edit this page to remove this text?

gorhill commented 9 years ago

You can paste text with comments in there, but these will be discarded. For uBlock, you could copy/paste all the rules here, and this will work fine even though there are comments in the pasted text.

Alpengreis commented 9 years ago

Yeah, I had tested it, BEFORE I maked my original post here, but was confused somehow after. THIS was the sense of my feature request, to have the same possibility with # as in uBlock :-) to make also commented templates for uMatrix, NOT for persisent comments ...

My intention was: if we could have the SAME logical for uMatrix and uBlock, it would be easier for users with both addons in use.

gorhill commented 9 years ago

As explained, comments can appear at parse time, they are discarded, uMatrix/uBlock all the same.

Alpengreis commented 9 years ago

Ah, I see, my template was somehow wrong. It's the same, correct! Sorry for the trouble!

holdhack commented 7 years ago

@gorhill just found this issue via Google. Commenting seems very useful (at least it would be to me) because that way I can know why I put a certain url+script on the whitelist, especially since a lot of them are very cryptic in name. Would this be an ok solution to you: keep a 'my_rules.txt' and 'my_rules_parsed.txt'. 'my_rules.txt' gets displayed under the 'my rules' tab, and the only thing uBlock does is discard anything that's not a valid rule or a #comment. 'my_rules.txt' is then parsed+saved as 'my_rules_parsed.txt', which gets used by the uBlock back-end. Newly added rules get added to the bottom of 'my_rules.txt' which is immediately parsed+saved to 'my_rules_parsed.txt'. :)

gorhill commented 3 years ago

I explained in uMatrix why this is not possible: https://github.com/gorhill/uMatrix/issues/314#issuecomment-128793820.