Closed borsboomm closed 4 months ago
When a Javascript class has a function with the name import Wabac tries to wrap it with _wb_rewriteimport
For example:
<script> class ContentImporter { constructor() { } import() { document.getElementById("import").innerHTML = 'Content written with import function'; } export() { document.getElementById("export").innerHTML = 'Content written with export function'; } init() { window.onload = () => { this.import(); this.export(); }; } } const importer = new ContentImporter(); importer.init(); </script>
It becomes:
class ContentImporter { constructor() { } ____wb_rewrite_import__(null, ) { document.getElementById("import").innerHTML = 'Content written with import function'; } export() { document.getElementById("export").innerHTML = 'Content written with export function'; } init() { window.onload = () => { this.import(); this.export(); }; } } const importer = new ContentImporter(); importer.init(); }
I've attached a simple warc file where the problem has been isolated from a much bigger real life example.
importfunction.gz
Thanks for reporting, should be fixed with better regex matching to ignore this use of 'import'. Will be in 2.17.2 release of wabac.js
@borsboomm This fix has now been released in ReplayWeb.page 1.8.16
When a Javascript class has a function with the name import Wabac tries to wrap it with _wb_rewriteimport
For example:
It becomes:
I've attached a simple warc file where the problem has been isolated from a much bigger real life example.
importfunction.gz