a123
a123

Reputation: 53

Firefox OS - Launch external link inside Firefox OS app and retrieve its content

I have a Firefox OS app in which I have opened an web page via mozbrowser attribute.

<iframe id="inlineFrameExample"
    mozbrowser=true 
    src="<some external link>"
</iframe>

How can we retrieve DOM content of the iframe?

Upvotes: 0

Views: 232

Answers (1)

a123
a123

Reputation: 53

You can retrieve DOM content via executeScript() method present in Browser API. It will run the script against the iframe and will allow you to do DOM computation tasks.

Note: The example mentioned in the document didn't worked but the syntax given below worked for me. The diff is is passed as string.

iframe.executeScript('put_your_script_here', {origin: 'domain_name'});

Upvotes: 0

Related Questions