monitor HTTP requests of external website

I want to write a script generator based on whats happening on the website, and for that I have written javascript - ajax based script generator, where on every page i do include the js file and within function block of page where page is submited I call the function of javascript to initiate reading of page variables ( DOM ) by getElementsByTagName(*), and after looping through it, I write predefined format to a file using ajax.

this all is done for the same site where its running, however now as when I needed to implement same for any other site as recorder and script generator as whats done on the website and to log into file, neither I can include my script on to any other external website nor put function call before submit to read dom and throw into file.

here is dummy code of js

 beginRecording();

function beginRecording()
{
    if(RECORD_BIT == 1)
    { 
       processPageData();   
    }
}

function processPageData()
{
  var i
  var obj = document
  var posArray = new Array();
  var allElement = obj.getElementsByTagName("*");
  var dataArrayString = "";

  for(i=0; i < allElement.length; i++)
  {
    if (allElement[i].getAttribute('id') != null && allElement[i].getAttribute('id') != "") 
    {
        posArray[posArray.length] = allElement[i].getAttribute('id');
    }
 }

 for(i = 0 ; i < posArray.length ; i++)
 {
    dataArrayString = dataArrayString+"SET  "+posArray[i]+"="+getValueFromPage(posArray[i]);
 }



  writePostData(dataArrayString);

}

The function writePostData, does ajax and writes/ updates file on the server by logging what was on DOM element, and I send couple of more details liek GET/POST or page name and so on..

beginRecording() is called on the page before javascript does a submit as document.forms[0].submit(), so that it can capture POST.

I read about cross domain ajax, but still I am not sure how can I monitor HTTP (read GET / POST and data on page or URL) of any external website without adding my script into that file, and write to file

any help or direction would be great.

Answers


You can't include javascript on a remote site, or monitor it's HTTP requests both of those things would be catastrophic to security...


Need Your Help

Using FFMPEG library with iPhone SDK for video encoding

iphone video encoding ffmpeg

I need to encode several pictures shot by the iphone camera into a mp4 video file and I know FFMPEG can do this (the application TimeLapser and ReelMoments do it already). I plan to use this in my ...

Netbeans can't add remote host running on Virtualbox

netbeans ssh virtualbox

I installed Ubuntu Server 15 on VirtualBox 5.0.10 and set up ssh access to the guest using NAT/port forwarding (host:3022->guest:22). The host is Windows 7 64bit.