0

I need to intercept and potentially rewrite/proxy various api requests such window.PostMessage, window.location.href, XHR etc. There are several solutions such xhook but these seem to work only for a small subset of APIs and only in specific browsers. So I'm wondering, what's the right way to do this? Is it possible to load an interpreter, load the whole DOM into it and somehow get hooks through the interpreter or some kind of DOM with webAPIs shim and get hooks on that? I'm aware that a such solution would be a bit slow but I don't really need high performance as this is supposed to be a short term solution to maintain some legacy code.

Books
  • 153
  • 1
  • 2
  • 11
  • I hope this is a one time activity to identify the api calls, maybe you can try out headless browsers like phantomjs – gvmani Nov 22 '17 at 08:46
  • Unfortunately it's not the case. It needs to run in the browser context until the legacy code is basically rewritten(more or less manually). – Books Nov 22 '17 at 09:57

0 Answers0