Content scripts run in their own world precisely to prevent the page from faking your content script out in this way. There's no way to get the "higher ground" over the page, but you can try a bare knuckle fight by injecting a script tag into the page that tries to fake the page out.
Adam On Fri, Jan 8, 2010 at 2:15 AM, David LECOMTE <[email protected]> wrote: > 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. > > > >
-- 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.
