Hello,

Is it possible to monitor XMLHttpRequest that are issued by a content page ?

Apparently the.
I was trying to replace XMLHttpRequest by my own version but the
content_script is in another "context" and does not know about the JS
running on the content page.

That's how i was trying :
var StashXMLHttpRequest = window['XMLHttpRequest'];
function MonitoredXMLHttpRequest() {}
MonitoredXMLHttpRequest.prototype = new StashXMLHttpRequest;
MonitoredXMLHttpRequest.prototype.constructor = MonitoredXMLHttpRequest;
MonitoredXMLHttpRequest.prototype.open = function(method, url, async, user,
                                                  password) {
  if (url) {
    chrome.extension.sendRequest(new SendMessageBackground(url));
  }
  return StashXMLHttpRequest.prototype.open.apply(
      this,[method, url, async, user, password]);
};

window['XMLHttpRequest'] = MonitoredXMLHttpRequest;


Is there a way to achieve something like that ?

Thank you in advance.
Regards,
David
-- 
You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to