Skip to content

Commit c96082c

Browse files
committed
wobmat rewrite: support "a.href = '.'" properly even if trailing / missing
1 parent 08849a5 commit c96082c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pywb/static/wombat.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,12 @@ var wombat_internal = function($wbwindow) {
447447
this._parser = make_parser(href);
448448
}
449449

450+
//Special case for href="." assignment
451+
if (prop == "href" && typeof(value) == "string" && value[0] == ".") {
452+
this._parser.href = $wbwindow.document.baseURI;
453+
value = this._parser.href;
454+
}
455+
450456
try {
451457
this._parser[prop] = value;
452458
} catch (e) {

0 commit comments

Comments
 (0)