This function really shouldn't try to parse the filter - there is some more to it than looking for "##" in the filter string. You should pass a `Filter` instance as argument here, meaning calling `validateFilter()` after `Filter.fromText()`. Extracting the selector is easy then:

    if (!(filter instanceof ElemHideBase))
      return true;
    var selector = filter.selector;

Note that this will also consider element hiding exceptions like `example.com#@#.foo`.