Repository navigation
Patch vendored wombat.js so element properties return/forget a recorded original - #386
Merged
benoit74 merged 1 commit intoNov 6, 2026
Conversation
benoit74
added a commit
that referenced
this pull request
Nov 6, 2026
…ed original img.src, script.src, link.href, a.href (and its derived .pathname/.search/...) and Attr.value only re-derived their value from the rewritten attribute via extractOriginalURL, unlike getAttribute which already prefers a server-side rewriter's recorded original. Assigning any of those properties also left the recorded original behind, unlike setAttribute. Proposed upstream as webrecorder/wombat#240; patch our vendored copy in the meantime, the same way the fetch()/Request() and Location-getter patches already do. (#386)
benoit74
force-pushed
the
benoit74/patch-wombat-element-properties-recorded-original
branch
from
November 6, 2026 16:58
9f5d303 to
1cd1e64
Compare
benoit74
deleted the
benoit74/patch-wombat-element-properties-recorded-original
branch
November 6, 2026 17:02
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #386 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 42 42
Lines 2937 2937
Branches 450 450
=========================================
Hits 2937 2937 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 6, 2026
Closed
benoit74
added a commit
to pawank925/python-scraperlib
that referenced
this pull request
Nov 12, 2026
…frame's true URL retrieveWBOSRCAsURL (added in openzim#386) resolved a server-recorded original attribute value against ownerDocument's replay-time baseURI. For a page whose own URL was changed by a fuzzy rule when it was stored in the ZIM (e.g. YouTube's embed page, served under youtube.fuzzy.replayweb.page/... while its real URL is www.youtube.com/embed/...), that's not the frame's true original URL, so a relative recorded value resolved to the wrong host -- the fuzzy-normalized replay path instead of the real one -- and a later fetch built from it 404'd, breaking playback. wb_info.url already holds the frame's true original URL (used the same way for Location getters, openzim#384); resolve against that instead, via a {baseURI: wb_info.url} stand-in so resolveRelUrl's own fallback chain still applies if wb_info.url isn't set. Fixes openzim#398
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getAttribute('src'|'href'|...)already returns a server-side rewriter's recorded original (via__wb_orig_<attr>), but the element properties that reflect those attributes (img.src,script.src,link.href,a.hrefand its derived.pathname/.search/..., andAttr.value) did not: they always re-derived their value from the rewritten attribute viaextractOriginalURL, which cannot reverse our ownurlRewriteFunction's path+query flattening (same underlying cause as theLocation-getter patch already in place).setAttribute, which already forgets it.rules/patch_wombat.pypatches our vendored copy in the meantime, following the exact same pattern as the existingfetch()/Request()andLocation-getter patches.Only
rules/patch_wombat.py(andCHANGELOG.md) are touched here; the vendoredwombat.jsitself is regenerated by theget_filebuild step, not committed alongside script changes (same as the two prior patches).