class XpathBuilder implements PathBuilder { getIdExpression ( elementId ) { return 'id("' + elementId + '")' ; } getDescendantSeparator ( ) { return "//" ; } getChildSeparator ( ) { return "/" ; } getMultipleTagNameAndClassNameExpression ( tagName , className ) { return tagName + '[contains(concat(" ",normalize-space(@class)," "),"' + className + '")]' ; } getSingleTagNameAndClassNameExpression ( tagName , className ) { return tagName + '[@class="' + className + '"]' ; } createPathFilter ( _path ) { let path = CustomBlockerUtil . trim ( _path ) ; return new XpathPathFilter ( path ) ; } } class XpathPathFilter implements PathFilter { path : string ; elements : HTMLElement [ ] ; constructor ( path ) { this . path = path ; this . elements = CustomBlockerUtil . getElementsByXPath ( path ) ; } }