LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-10-2012, 10:30 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
javascript - chrome: problem with iframe's parent


Hi!

I'm developing an application on phonegap and running it on android. I want to send a meesage to a page from a double-nested iframe.

On Android 2.2 it works if I do this:

Code:
parent.parent.postMessage('whatever', '*');
But then I try on Android 4 and it doesn't work.... I checked with javascript the location of each "parent" and on Android 4 it always returns the same address of the iframe I'm trying to send the message from and in 2.2 it returns the "right" address of each iframe. Why is that?
 
Old 07-10-2012, 10:38 AM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I just performed a very simple test. I tested if window == parent. On 2.2 it's not the same... on 4.0 it is the same. Does it make any sense?
 
Old 07-10-2012, 10:43 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
How interesting:

http://productforums.google.com/foru...me/KXWxXF6RJZY

Is it because a phonegap application runs locally? Ugh! Is there a workaround for this?
 
Old 07-10-2012, 11:16 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I had tried a very small application with an iframe that sent a message to its parent. I tested it running in apache from android's browser and it works. I just tested it from inside phonegap and it fails.... so I guess "running locally" is to blame here. So.... is there a workaround? perhaps changing something in the manifest?
 
  


Reply

Tags
android, chrome, iframe, javascript, parent



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Google Chrome 10 advances with new V8 3 JavaScript engine LXer Syndicated Linux News 0 01-21-2011 04:00 PM
A virus changed all my index files with iframe, how to remove that iframe line? Farman Linux - Security 10 07-16-2009 08:40 AM
LXer: Google Chrome: It’s all about the Javascript LXer Syndicated Linux News 0 10-23-2008 06:41 PM
force iframe content to remain in iframe? frieza Programming 1 09-17-2008 06:29 AM
javascript - submit an iframe form AM1SHFURN1TURE Programming 1 09-23-2006 05:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration