DOMParser() undefined while running JS own scripts
457 views
Skip to first unread message
KHUSHBOO KUMARI
unread,
Mar 16, 2021, 5:32:21 AM3/16/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to OWASP ZAP Scripts
Hi everyone, Does ZAP support DOMParser() and require('fs') in javascript proxy scripting? I am getting error as DOMParser() undefined. I need it for parsing string containing serialised XML response i.e of format text/xml. How can I make it work in ZAP?
Simon Bennetts
unread,
Mar 16, 2021, 5:49:20 AM3/16/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to OWASP ZAP Scripts
ZAP Proxy scripts run in ZAP rather than in a browser. This means that browser features such as DOMParser are not available.
However you do have access to all of the functionality available within ZAP, and that includes an XML parser :)
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to OWASP ZAP Scripts
Also, How can I add my own java file to use with Javascript file in ZAP? Because later after parsing text/xml I need to add/replicate some tag to the httpmessage response which is in form of text/xml. Please help if it can be done.
thc...@gmail.com
unread,
Mar 23, 2021, 3:11:11 AM3/23/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zaproxy...@googlegroups.com
Hi.
You can use the Java classes directly from the script (refer to syntax
of the engine used).