Tyler Jones
Tyler Jones

Reputation: 1363

detecting http requests coming from an iframe

okay, my scenario is that i have an iframe on a page, that is calling a url on a different domain. This url sometimes will tunnel (not a full redirect) to a different url than the one i'm calling. I know I cannot look at the contents of the iframe, since I'm calling a different domain, but is there any way to detect that the url tunneled to a different url than the src property of the iframe? For example, is there a way to detect the http requests that are coming from a page?

IF the url is tunneled to a different url, then I need to redirect the user off the current page, because that means their session has expired (i know this doesn't make much sense, and there should be a much better way of detecting a session is dead, but this is the only way I have to do this right now).

Upvotes: 2

Views: 3717

Answers (2)

srini.venigalla
srini.venigalla

Reputation: 5145

Download Fiddler and configure your browser, it will show all HTTP requesting going through your application. You can also install firebug extension in Firefox and check the HTTP rquests in the "Net" tab of Firebug.

Using Fiddler to capture the cross domain requests http://blog.caplin.com/2010/03/19/using-fiddler-to-help-develop-cross-domain-capable-javascript-web-applications/

Upvotes: 1

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114447

The only thing you can hook onto in a "different origin" iframe is the onload event of the iframe itself. For anything else, you'll need a plug-in.

Upvotes: 1

Related Questions