Constructor Summary
Public Constructor | ||
public |
constructor($wbwindow: Window, wbinfo: Object) |
Member Summary
Public Members | ||
public |
location: * |
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
|
|
public |
check replay-iframe location and replay_top location |
|
public |
check_location_change(wombat_loc: WombatLocation, is_top: boolean) 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 |
|
public |
init_wombat_loc(win: Window) Init WombatLocation for the window |
|
public |
Override XMLHttpRequest.prototype.open in order to
|
|
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}
|
|
public |
Override Node.{appendChild,insertBefore,replaceChild}
|
|
public |
Override $wbwindow.frames to ensure wombat is inited on them |
|
public |
override_history_func(func_name: string): function Overrides a function on the history object by name |
|
public |
override_history_nav(func_name: string): function 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
|
|
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 Members
public location: * source
public wb_rel_prefix: * source
public wb_rel_prefix_check: * 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_location_change(wombat_loc: WombatLocation, is_top: boolean) source
Check if the location has changed
Params:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
iframe | HTMLIFrameElement | HTMLFrameElement |
public init_new_window_wombat(win: *, src: *) source
Params:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
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_attr(obj: Object, attr: string, mod: string, default_to_setget: boolean) source
Override the getter/setter of an objects property
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}
- if the child is an instanceof window.Element WombatRewriter#rewrite_elem
- if the child is style WombatRewriter#rewrite_style
- if the child is an iframe WBWombat#init_iframe_wombat
public override_history_func(func_name: string): function source
Overrides a function on the history object by name
Params:
Name | Type | Attribute | Description |
func_name | string | the name of the history function to override |
public override_history_nav(func_name: string): function source
Overrides a function on the history object by name
Params:
Name | Type | Attribute | Description |
func_name | string |
public override_htmlBaseElem_nodeBaseURI() source
Override HTMLBaseElement.{getAttribute,href} and Node.baseURI
public override_html_assign(elemtype: HTMLElement | HTMLIFrameElement | HTMLStyleElement, prop: string) source
Params:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
prop | string |
public override_prop_extract(proto: Object.prototype, prop: string, cond: function) source
Params:
Name | Type | Attribute | Description |
proto | Object.prototype | ||
prop | string | the prop name to define a getter for |
|
cond | function |
|
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
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
elem | * | ||
func | * |
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} |