0

Well, I have to admit this is a very odd question but I do need a solution ASAP:

I am working on a JS testing project that requires the following working flow:

  1. extract all the js from a webpage
  2. use v8 shell or d8 to scan and parse those javascripts (do not need to actually execute it). Currently I don't want to use browsers such as chrome to do this, I only want to use v8 shell or d8.

The problem I have met is that the extracted JS contains DOM operations, including document.write(), which essentially contains a piece of html. I tried to search pure javascript implementation of DOM api without invoking third party libraries such as node.js, but no luck.

Since the document.write() contains html code, I also need a HTML parser, right? Is there anyway that I can make (2) working? I noted that since I only need the scan and parse part of v8, a mock-up of the DOM api may work, but I don't know how to do this for document.write.

BTW, Is there any headless browser using V8 under linux?

Thanks!

Wei Ding
  • 21
  • 1
  • 1
  • 4

0 Answers0