Home Reference Source

Function

Static Public Summary
public

WrappedListener(orig_listener: function, win: Window): Object

Wrap the original eventListener for type "message"

  • if the events data.to_host is not "*" and windows WB_wombat_location host is not equal to the events data.to_host skip
  • if the events data is from top sets the source to __WB_top_frame
  • if the events data.src_id and __WB_win_id object exists and the events data.src_id has a mapping in __WB_win_id set the source to that mapping
public

def_prop(obj: DomElement | MessageEvent | JSNative, prop: string, set_func: function, get_func: function, enumerable: boolean): boolean

Override a property on the given object by defining either its setter or getter or both

public

ends_with(str: string, suffix: string): string | undefined

Determines if the string ends with the given suffix

public

equals_any(string: string, arr: string[]): string | undefined

Determines if the string is equal to any string in an array

public

Retrieve the original getter for an property on an object

public

Retrieve the original setter for an property on an object

public

Determines if a given string is a host url

public
  • if window is null or undefined return false
  • if win.wbinfo is falsey return win._wb_wombat !== undefined else return !win.wbinfo.is_frame
  • if an Exception occurs returns false
public

starts_with(string: string, arr_or_prefix: string | string[]): string | undefined

Determines if a given string starts with single prefix or an array of prefixes

Static Public

public WrappedListener(orig_listener: function, win: Window): Object source

Wrap the original eventListener for type "message"

  • if the events data.to_host is not "*" and windows WB_wombat_location host is not equal to the events data.to_host skip
  • if the events data is from top sets the source to __WB_top_frame
  • if the events data.src_id and __WB_win_id object exists and the events data.src_id has a mapping in __WB_win_id set the source to that mapping

Params:

NameTypeAttributeDescription
orig_listener function

the original message eventListener

win Window

the window the message eventListener is applied to

Return:

Object

the true listener {listen: function listen(event)}

public def_prop(obj: DomElement | MessageEvent | JSNative, prop: string, set_func: function, get_func: function, enumerable: boolean): boolean source

Override a property on the given object by defining either its setter or getter or both

Params:

NameTypeAttributeDescription
obj DomElement | MessageEvent | JSNative
prop string
  • nullable: false

the property to override

set_func function
  • nullable: true

the set function override for the property

get_func function
  • nullable: true

the get function override for the property

enumerable boolean
  • nullable: true

true if and only if this property shows up during enumeration of the properties on the corresponding object.

Return:

boolean

true if the objects property was overridden successfully otherwise false

See:

public ends_with(str: string, suffix: string): string | undefined source

Determines if the string ends with the given suffix

Params:

NameTypeAttributeDescription
str string

the string to test

suffix string

the suffix to test the string with

Return:

string | undefined

returns the suffix if the string ends with it otherwise undefined

public equals_any(string: string, arr: string[]): string | undefined source

Determines if the string is equal to any string in an array

Params:

NameTypeAttributeDescription
string string

the string to test

arr string[]

the array containing elements to match string to

Return:

string | undefined

returns the array element the string matches otherwise returns undefined

public get_orig_getter(obj: Object, prop: string): function source

Retrieve the original getter for an property on an object

Params:

NameTypeAttributeDescription
obj Object
prop string

Return:

function (nullable: true)

public get_orig_setter(obj: Object, prop: string): function source

Retrieve the original setter for an property on an object

Params:

NameTypeAttributeDescription
obj Object
prop string

Return:

function (nullable: true)

public is_host_url(str: string): boolean source

Determines if a given string is a host url

Params:

NameTypeAttributeDescription
str string

the string to test

Return:

boolean

returns true if the str is a host url false otherwise

public next_parent(win: Window): boolean source

  • if window is null or undefined return false
  • if win.wbinfo is falsey return win._wb_wombat !== undefined else return !win.wbinfo.is_frame
  • if an Exception occurs returns false

Params:

NameTypeAttributeDescription
win Window

Return:

boolean

public starts_with(string: string, arr_or_prefix: string | string[]): string | undefined source

Determines if a given string starts with single prefix or an array of prefixes

Params:

NameTypeAttributeDescription
string string
  • nullable: true

the string to test

arr_or_prefix string | string[]

the prefix(s)

Return:

string | undefined

returns the matched prefix if the string starts with it otherwise undefined