pywb
pywb copied to clipboard
`this` rewriting can affect dynamically generated content on the page
Describe the bug
pywb rewrites all this uses to use a wrapper. However, the rewriting can be a bit overzealous, since it does so inside strings. For example, document.querySelector("p").innerText = "well, this is awkward" gets rewritten into document.querySelector("p").innerText = "well, _____WB$wombat$check$this$function_____(this) is awkward"
Steps to reproduce the bug
- Download test.warc.gz
wb-manager init testwb-manager add test test.warc.gz- Go to http://localhost:8080/test/http://localhost:8000/ (for an example), or http://localhost:8080/test/https://stainedglasswoman.substack.com/p/slivers (for an occurance in the wild)
Expected behavior
The rewrite to not hapen inside strings
Screenshots
Environment
- OS: Arch Linux
- Browser: Librewolf
- Version: 121.0-1