Home Reference Source
public class | source

Wombat

Extends:

WombatInit → Wombat

The Wombat proper class

Constructor Summary

Public Constructor
public

constructor($wbwindow: Window, wbinfo: Object)

Member Summary

Public Members
public
public
public
public

Method Summary

Public Methods
public
  • Override the href, src attributes of HTML Elements
    • HTMLLinkElement.prototype, href, cs_
    • CSSStyleSheet.prototype, href, cs_
    • HTMLImageElement.prototype, src, im_
    • HTMLIFrameElement.prototype, src, if_
    • HTMLScriptElement.prototype, src, js_
    • HTMLVideoElement.prototype, src, oe_
    • HTMLVideoElement.prototype, poster, im_
    • HTMLAudioElement.prototype, src, oe_
    • HTMLAudioElement.prototype, poster, im_
    • HTMLSourceElement.prototype, src, oe_
    • HTMLSourceElement.prototype, srcset, oe_
    • HTMLInputElement.prototype, src, oe_
    • HTMLEmbedElement.prototype, src, oe_
    • HTMLObjectElement.prototype, data, oe_
  • Override the attribute of CSSStyleDeclaration.prototype if not FireFox otherwise CSS2Properties.prototype
    • cssText
    • background, background
    • backgroundImage, background-image
    • listStyle, list-style
    • listStyleImage, list-style-image
    • border, border
    • borderImage, border-image
    • borderImageSource, border-image-source
public

check replay-iframe location and replay_top location

public

Check if the location has changed

public
public

Override the form action attribute of all forms in the page being replayed

public

init_iframe_wombat(iframe: HTMLIFrameElement | HTMLFrameElement)

Init wombat on an iframe

public

init_new_window_wombat(win: *, src: *)

public

Initialize __WB_replay_top, __WB_top_frame, __WB_orig_parent, __WB_orig_parent to the correct values

public

Init WombatLocation for the window

public

Override XMLHttpRequest.prototype.open in order to

  • rewrite the URL unless Wombat is to not perform rewrites.
public

Override the HTMLAnchorElement properties

public

override_attr(obj: Object, attr: string, mod: string, default_to_setget: boolean)

Override the getter/setter of an objects property

public

Override Attr.{nodeValue,value}

public

Override document.createElement.

public

Override document.{write,writeln,open}

  • rewrites the html string
  • if the html string is an html element that is contains its own window instance initialize a new instance of Wombat associated with the new window
public

Override Node.{appendChild,insertBefore,replaceChild}

public

Override $wbwindow.frames to ensure wombat is inited on them

public

Overrides a function on the history object by name

public

Overrides a function on the history object by name

public

Override HTMLBaseElement.{getAttribute,href} and Node.baseURI

public

override_html_assign(elemtype: HTMLElement | HTMLIFrameElement | HTMLStyleElement, prop: string)

public

iframe.contentWindow and iframe.contentDocument overrides to ensure wombat is inited on the iframe $wbwindow

public

override_prop_extract(proto: Object.prototype, prop: string, cond: function)

public

override_style_attr(obj: Object, attr: string, prop_name: string)

Override the a style attribute on an object

public

Override window.open in order to

  • rewrite the url of the new window
  • initialize and associate a new instance of Wombat for the new window
  • override the open method of the current replay windows frames
public

update_location(req_href: string, orig_href: string, actual_location: Location, wombat_loc: WombatLocation)

Update the WombatLocation

public

watch_elem(elem: *, func: *): boolean

Utility functions used by rewriting rules

public

wombat_init(): {extract_orig: function,rewrite_url: function,watch_elem: function, init_new_window_wombat: function,init_paths: function}

setup wombat

Public Constructors

public constructor($wbwindow: Window, wbinfo: Object) source

Params:

NameTypeAttributeDescription
$wbwindow Window
wbinfo Object

Public Members

public location: * source

public wb_rel_prefix: * source

public wb_rel_prefix_check: * source

public wb_wombat_updating: boolean source

Public Methods

public attr_overrides() source

  • Override the href, src attributes of HTML Elements
    • HTMLLinkElement.prototype, href, cs_
    • CSSStyleSheet.prototype, href, cs_
    • HTMLImageElement.prototype, src, im_
    • HTMLIFrameElement.prototype, src, if_
    • HTMLScriptElement.prototype, src, js_
    • HTMLVideoElement.prototype, src, oe_
    • HTMLVideoElement.prototype, poster, im_
    • HTMLAudioElement.prototype, src, oe_
    • HTMLAudioElement.prototype, poster, im_
    • HTMLSourceElement.prototype, src, oe_
    • HTMLSourceElement.prototype, srcset, oe_
    • HTMLInputElement.prototype, src, oe_
    • HTMLEmbedElement.prototype, src, oe_
    • HTMLObjectElement.prototype, data, oe_
  • Override the attribute of CSSStyleDeclaration.prototype if not FireFox otherwise CSS2Properties.prototype
    • cssText
    • background, background
    • backgroundImage, background-image
    • listStyle, list-style
    • listStyleImage, list-style-image
    • border, border
    • borderImage, border-image
    • borderImageSource, border-image-source

public check_all_locations(): boolean source

check replay-iframe location and replay_top location

Return:

boolean

public check_location_change(wombat_loc: WombatLocation, is_top: boolean) source

Check if the location has changed

Params:

NameTypeAttributeDescription
wombat_loc WombatLocation
is_top boolean

public init_doc_overrides() source

public init_form_overrides() source

Override the form action attribute of all forms in the page being replayed

public init_iframe_wombat(iframe: HTMLIFrameElement | HTMLFrameElement) source

Init wombat on an iframe

Params:

NameTypeAttributeDescription
iframe HTMLIFrameElement | HTMLFrameElement

public init_new_window_wombat(win: *, src: *) source

Params:

NameTypeAttributeDescription
win *
src *

public init_top_frame() source

Initialize __WB_replay_top, __WB_top_frame, __WB_orig_parent, __WB_orig_parent to the correct values

public init_wombat_loc(win: Window) source

Init WombatLocation for the window

Params:

NameTypeAttributeDescription
win Window

public override_ajax() source

Override XMLHttpRequest.prototype.open in order to

  • rewrite the URL unless Wombat is to not perform rewrites.
  • if the URL begins with "data:" add X-Pywb-Requested-With

public override_anchor_elem() source

Override the HTMLAnchorElement properties

public override_attr(obj: Object, attr: string, mod: string, default_to_setget: boolean) source

Override the getter/setter of an objects property

Params:

NameTypeAttributeDescription
obj Object

the object to apply the override

attr string

the name of the property

mod string
default_to_setget boolean

public override_attr_props() source

Override Attr.{nodeValue,value}

public override_createElement() source

Override document.createElement.

  • if the element to be created is an HTML.Form override its action attribute.
  • if the skip parameter of document.createElement is set to a truthy value adds _no_rewrite property to the element indicating it is not to be rewritten

public override_document_write() source

Override document.{write,writeln,open}

  • rewrites the html string
  • if the html string is an html element that is contains its own window instance initialize a new instance of Wombat associated with the new window

public override_dom_functions() source

Override Node.{appendChild,insertBefore,replaceChild}

public override_frames_access() source

Override $wbwindow.frames to ensure wombat is inited on them

public override_history_func(func_name: string): function source

Overrides a function on the history object by name

Params:

NameTypeAttributeDescription
func_name string

the name of the history function to override

Return:

function

the rewritten func

public override_history_nav(func_name: string): function source

Overrides a function on the history object by name

Params:

NameTypeAttributeDescription
func_name string

Return:

function

the rewritten func

public override_htmlBaseElem_nodeBaseURI() source

Override HTMLBaseElement.{getAttribute,href} and Node.baseURI

public override_html_assign(elemtype: HTMLElement | HTMLIFrameElement | HTMLStyleElement, prop: string) source

Params:

NameTypeAttributeDescription
elemtype HTMLElement | HTMLIFrameElement | HTMLStyleElement
prop string

the property name to override

public override_iframe_content_access(prop: string) source

iframe.contentWindow and iframe.contentDocument overrides to ensure wombat is inited on the iframe $wbwindow

Params:

NameTypeAttributeDescription
prop string

public override_prop_extract(proto: Object.prototype, prop: string, cond: function) source

Params:

NameTypeAttributeDescription
proto Object.prototype
prop string

the prop name to define a getter for

cond function
  • nullable: true

function that determines if the returned value from the getter is the result of WombatRewriter#extract_orig on the original value

public override_style_attr(obj: Object, attr: string, prop_name: string) source

Override the a style attribute on an object

Params:

NameTypeAttributeDescription
obj Object

the style prototype to apply the override to

attr string

the name of the property to override

prop_name string

the name of property to get/set

public override_window_open() source

Override window.open in order to

  • rewrite the url of the new window
  • initialize and associate a new instance of Wombat for the new window
  • override the open method of the current replay windows frames

TODO:

  • was init_open_override

public update_location(req_href: string, orig_href: string, actual_location: Location, wombat_loc: WombatLocation) source

Update the WombatLocation

Params:

NameTypeAttributeDescription
req_href string
orig_href string
actual_location Location
wombat_loc WombatLocation

public watch_elem(elem: *, func: *): boolean source

Utility functions used by rewriting rules

Params:

NameTypeAttributeDescription
elem *
func *

Return:

boolean

public wombat_init(): {extract_orig: function,rewrite_url: function,watch_elem: function, init_new_window_wombat: function,init_paths: function} source

setup wombat

Return:

{extract_orig: function,rewrite_url: function,watch_elem: function, init_new_window_wombat: function,init_paths: function}