Class: Utils

Help4.selector.methods.Utils()

Util class for selector methods

Constructor

new Utils()

Source:

Methods

(static) createSmartUrl(type, url) → {Array.<string>}

Parameters:
Name Type Description
type string
url string
Source:
Returns:
Type
Array.<string>

(static) extractHref(config, elem) → {string}

extracts href (full url) from given element
Parameters:
Name Type Description
config Object
elem HTMLElement
Source:
Returns:
Type
string

(static) extractSrc(config, elem) → {string}

extracts src (reduced url) from given element
Parameters:
Name Type Description
config Object
elem HTMLElement
Source:
Returns:
Type
string

(static) extractText(config, elem) → {string}

Parameters:
Name Type Description
config Help4.selector.methods.Utils.Config
elem HTMLElement
Source:
Returns:
Type
string

(static) getElement(selector) → (nullable) {HTMLElement}

Parameters:
Name Type Description
selector string
Source:
Returns:
Type
HTMLElement

(static) improveInitialElement(config, elem) → {HTMLElement}

Parameters:
Name Type Description
config Help4.selector.methods.Utils.Config2
elem HTMLElement
Source:
Returns:
Type
HTMLElement

(static) matchesSelector(elem, selector) → {boolean}

IE11 compatibility. checks if element matches the selector
Parameters:
Name Type Description
elem HTMLElement
selector string
Source:
Returns:
Type
boolean

(static) matchesText(config, elem, expectedText) → (nullable) {string}

Parameters:
Name Type Description
config Help4.selector.methods.Utils.Config
elem HTMLElement
expectedText string
Source:
Returns:
Type
string

(static) record()

record selector
Source:

Type Definitions

Config

Type:
  • Object
Properties:
Name Type Description
depthThreshold number
desiredMinLength number
enabled boolean
filter Array.<string>
ignoreNumbers boolean
invalidClasses Array.<string>
minLength number
tags Array.<string>
textSize Help4.control2.SizeWidthHeight
truncationLength number
Source:

Config2

Type:
  • Object
Properties:
Name Type Description
enabled boolean
elements Array.<{tagName: string}>
searchLevel number
skippedTags Array.<string>
Source: