LGTM
Feel free to either reject the proposed approach or otherwise implement it in a
separate review.
https://codereview.adblockplus.org/29329521/diff/29329522/lib/requestNotifier.js
File lib/requestNotifier.js (right):
https://codereview.adblockplus.org/29329521/diff/29329522/lib/requestNotifier...
lib/requestNotifier.js:217: if (filterType != "elemhide" && filterType !=
"elemhideexception" && filterType != "cssproperty")
Just a suggestion: What about introducing an `isException` boolean property in
addition to the `type` property you introduced. That'd allow us to have a common
type for ElemHideFilter and ElemHideException that we can check for - similar to
how we currently check for ElemHideBase.
That'd allow us to keep checking filter inheritance at least to some extent
without introducing too much overhead.
https://codereview.adblockplus.org/29329521/diff/29329522/lib/requestNotifier.js
File lib/requestNotifier.js (right):
https://codereview.adblockplus.org/29329521/diff/29329522/lib/requestNotifier...
lib/requestNotifier.js:217: if (filterType != "elemhide" && filterType !=
"elemhideexception" && filterType != "cssproperty")
On 2015/11/03 11:32:40, Thomas Greiner wrote:
> Just a suggestion: What about introducing an `isException` boolean property in
> addition to the `type` property you introduced. That'd allow us to have a
common
> type for ElemHideFilter and ElemHideException that we can check for - similar
to
> how we currently check for ElemHideBase.
>
> That'd allow us to keep checking filter inheritance at least to some extent
> without introducing too much overhead.
I think that would complicate things more than it would help. Right now there is
a 1:1 mapping between types and type strings, that's very straightforward. If
the type structure gets any more complicated we might want to think about type
identifiers like "elemhide:exception" and "elemhide:cssproperty" but I don't
think we are at a point where this would make sense.
Issue 29329521: Issue 3222 - Expose filter type as a string property
(Closed)
Created 4 years, 1 month ago by Wladimir Palant
Modified 4 years ago
Reviewers: Thomas Greiner, tschuster
Base URL:
Comments: 2