I want to parse JS code from a webpage for some business reasons. I have to use C#
, .net
, visual studio
. I am using the library Microsoft.Ajax.Utilities
Problem is after many tries, I cannot find documentation for this library, and I need to use a class called ASTNode
and JSParser
inside this package. I tried to use Go to implementation feature in visual studio, but I think proper documentation is needed since I am new to parsing JS code. Any help is much appreciated.
Asked
Active
Viewed 772 times
0

Niraj Motiani
- 71
- 1
- 8
-
1[Does this help?](https://stackoverflow.com/a/2291050/16764901) I found that it seems to be included in Minifier, [here is some introduction of Minifier](https://stackoverflow.com/questions/5888580/ajax-minifier-ajaxmin-evaltreatment-for-javascript) and [so on](https://github.com/microsoft/ajaxmin). – Jiale Xue - MSFT Nov 04 '21 at 01:53
-
Thanks for the comment but it does not help. You talked about minifier which has some documentation, but I am looking for parser related documentation. Specifically, ```Microsoft.Ajax.Utilities.ASTNode``` and its examples. So, my requirement is not to minify but to parse the JS Code for strings that are going to be visible on the screen, you know like alert box strings and such. But thanks anyways! – Niraj Motiani Nov 04 '21 at 18:08
-
Must you use that function? It seems a bit old, and it is difficult for me to find information about it.[Are these links](https://stackoverflow.com/a/4748886/16764901) [helpful to you?](https://stackoverflow.com/questions/27981222/youtube-signature-decipher-with-an-working-example-for-vb-net/28006836#) – Jiale Xue - MSFT Nov 09 '21 at 09:20
-
Yes, I had to see that method and the overall documentation just to see what's going on. Problem is, nobody directly uses this library, everyone uses the library that depends on this one, but we found a work around by just taking strings and then replacing the arguments if they match and then update code as string (Senior dev on team helped ;- ) – Niraj Motiani Nov 12 '21 at 21:56
1 Answers
0
There is no clear documentation for some reason. We found a work around by taking a new string and just string replace methods (hacky solution I know but such is life)

Niraj Motiani
- 71
- 1
- 8
-
1Glad to know you've found the solution to resolve this issue! Please consider accepting it as an answer to change its status to Answered. See [can I answer my own question..](https://stackoverflow.com/help/self-answer), Just a reminder :) – Jiale Xue - MSFT Nov 15 '21 at 01:16