Skip to main content
September 18, 2011
Answered

Manipulating iframe content

  • September 18, 2011
  • 1 reply
  • 582 views

Hello,

I face some problem, i am using jquery as my framework, and i got an issue with the iframe content.

What i want to do is the load external website into my iframe (random website url from my database), and to insert my script into header (i want to do something like greasemonkey does on firefox).

Here's my code:

$('iframe').contents().find('header').append('<script>My user script</script>');

The problem is that this doesn't work, when i tried to do $('iframe').contents().find('header').html() returns nothing...

I knew this was a limitation in html because of cross domain, but adobe air isn't restricted to that, so what am i doing wrong here?

This topic has been closed for replies.
Correct answer chris.campbell

I'm not versed in the AIR html security model, so I'm going to forward this over to our webkit team.  My hunch is you are running into a security related restriction.  If you haven't already, please take a look at the following pages:

HTML Security in Adobe AIR

Cross-scripting content in different security sandboxes

Thanks,

Chris

1 reply

chris.campbell
chris.campbellCorrect answer
Legend
September 19, 2011

I'm not versed in the AIR html security model, so I'm going to forward this over to our webkit team.  My hunch is you are running into a security related restriction.  If you haven't already, please take a look at the following pages:

HTML Security in Adobe AIR

Cross-scripting content in different security sandboxes

Thanks,

Chris

September 19, 2011

Thanks for answering my question, too bad i can't do this using air , i loved the sintax.