You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we add the browser polyfill to all files ending in .ts. This works nicely to make sure it's available in content scripts, but has limitations. Namely, adding a script tag to the page and referencing a JS file from the extension will try to load the polyfill, and fail because the script is being loaded in the normal world and without access to browser APIs.
We should probably make which files to polyfill configurable or do some sort of AST search for a call to browser.
The text was updated successfully, but these errors were encountered:
Starting looking at this. @typescript/sandbox does provide a way of getting the AST, but it only returns it for the current program, rather than letting you pass in individual files. This seems to cause some errors to be thrown that I need to look in to further.
Currently, we add the browser polyfill to all files ending in .ts. This works nicely to make sure it's available in content scripts, but has limitations. Namely, adding a script tag to the page and referencing a JS file from the extension will try to load the polyfill, and fail because the script is being loaded in the normal world and without access to browser APIs.
We should probably make which files to polyfill configurable or do some sort of AST search for a call to
browser.
The text was updated successfully, but these errors were encountered: