InAppBrowser Get response from the browser



I want to use a url in a the open method on to to a url of my nodeJS back end that redirects to facebook and afterwards send a a token by json as a response back to the client, I need to get that json content and the hhtp headers.

I saw in the documentation that you only get as a parameter to the callback the event structure, that has only the url, and erros if exist.

I need to get the json response that was sent in the InAppBrowser,
I thought maybe to use the executeScript method and write some script that gets me the content on exit().

Am I on the right path? Is there a better or easier way to get the response? Is there an example for this, I think I am not the first one who needs it but yet I am not finding any reference for it.