Closed Alpengreis closed 9 years ago
As in uMatrix
uMatrix does not support comments in rules.
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?
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.
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.
As explained, comments can appear at parse time, they are discarded, uMatrix/uBlock all the same.
Ah, I see, my template was somehow wrong. It's the same, correct! Sorry for the trouble!
@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'. :)
I explained in uMatrix why this is not possible: https://github.com/gorhill/uMatrix/issues/314#issuecomment-128793820.
As in uMatrix it would be good to have the possibility to make comments in "My rules" (with the # char).