When rewriting JS code, wabac uses a JS parser (acorn) to parse JS and correctly detect all JS variables.
For now, our Python equivalent in python-scraperlib is not correctly rewriting these globals in all situations due to the fact that we miss a JS parser and code equivalent to wabac.JS
This is wabac code for which we miss an equivalent in Python scraperlib:
https://github.com/webrecorder/wabac.js/blob/0564e36993f4044f17119e71dd7b2892512ee59c/src/rewrite/jsrewriter.ts#L394-L452
I don't know yet if we can include a JS parser (equivalent to acorn) in the scraperlib or do things differently.
When rewriting JS code, wabac uses a JS parser (
acorn) to parse JS and correctly detect all JS variables.For now, our Python equivalent in python-scraperlib is not correctly rewriting these globals in all situations due to the fact that we miss a JS parser and code equivalent to wabac.JS
This is wabac code for which we miss an equivalent in Python scraperlib:
https://github.com/webrecorder/wabac.js/blob/0564e36993f4044f17119e71dd7b2892512ee59c/src/rewrite/jsrewriter.ts#L394-L452
I don't know yet if we can include a JS parser (equivalent to acorn) in the scraperlib or do things differently.