Request: Remove usage of Function() to load the XPathParser_raw
See original GitHub issueWe use fontoxpath in the browser and due to the use of Function when loading the generated XPath Parser we have to set unsafe-eval on our script sources CSP, which isn’t particularly ideal.
Is it possible for the generated parser to be built and imported in a more standard way? Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Remove and RemoveIf functions in Power Apps
Use the Remove function to remove a specific record or records from a data source. For collections, the entire record must match.
Read more >Adding and Removing Event Listeners with parameters
cleanUpMyListener () ... Step 3) Use the function reference to remove the listener ... When the event is fired, call the wrapping function...
Read more >remove_action() | Function - WordPress Developer Resources
Description. This can be used to remove default functions attached to a specific action hook and possibly replace them with a substitute. To...
Read more >Removing Event Listeners with removeEventListener()
In order to use the removeEventListener() method, we need to use a function declaration, or store our function expression into a variable ...
Read more >EventTarget.removeEventListener() - Web APIs | MDN
The event listener function of the event handler to remove from the ... wise to use the same values used for the call...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I just integrated the PR. I’m making a new release right now.
Hey @ymor,
We have that
new Functionshenanigan because of historic reasons. This repo used to be a pure Closure Compiler project which, at the time, had no way of disabling the compiler for specific files. So we had to resort to evaluating a string, yadayadayadaNow that we use TypeScript, there exists the
// @ts-ignoreflag, which does work.I gave this another try, and it worked. Furthermore, I saw a 10kB reduction in the overall filesize of the esm bundle of FontoXPath: 385kB -> 375kB, which is imho pretty significant. It also removes the dependency on uglifyJS, which is admirable in itself!
Thanks for pointing this out!
Regards,
Martin