Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture status from the child page inside iframe #47

Closed
suriyanto opened this issue Jun 30, 2014 · 2 comments
Closed

Capture status from the child page inside iframe #47

suriyanto opened this issue Jun 30, 2014 · 2 comments

Comments

@suriyanto
Copy link

Hello,

I am trying to capture error status from a child page that I am loading from pym. When the child page detects invalid user, it will return status 401 on the header and I want to be able to get that status and redirect the user to the parent site's login page.

How can I get this status code from the child page?

Thanks,
Suriyanto

@miohtama
Copy link

miohtama commented Jul 1, 2014

If you are not hosting the child page yourself you cannot do this. By the security rules of the web browser, you cannot access the status of web pages loaded from other servers.

If you are hosting the page yourself then modify the child page to signal the parent page about its status via JavaScript.

@onyxfish
Copy link

onyxfish commented Jul 1, 2014

Yep, what @miohtama. This isn't really an issue specific to pym, although you can look at how we do the cross-iframe messaging and use that logic to send your own communications. In this case status codes may be a bad way to communicate error states though.

@onyxfish onyxfish closed this as completed Jul 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants