Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
window.parent and window.top are suddenly equal to window.self

I have a web app (B) which is hosted in another application (A) using an Iframe. My web application can without problems post messages (parent.postMessage(“my message", “*”)) to the parent, B.

My app has a link which points to an external web application (C). The link contains a redirectUrl which application C will call (POST) when it is done. The url points to an action in my application. The action ends up by ensuring that the current location is the same as before the user clicked the link:

    …
    var response = Request.CreateResponse(HttpStatusCode.Found);
    response.Headers.Location = new Uri(currentExecutionUrl);
    return response;

Now, once the user returns to my application from application C, it is no longer possible to post messages from my application the parent, A. When debugging the client, I can see the reason for this: window.self, window.parent and window.top are all identical and equal to my application’s window/document.

Notice that this only happens with iPhone / webkit. With android devices and desktop browsers it works as it should, i.e. the parent and top windows properties point to A as expected.

Any help is appreciated!

Thanks

Hank

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!