Accessing iframe content with a Chrome extension - not via content script

4,932 views
Skip to first unread message

UVL

unread,
Apr 5, 2012, 8:30:28 AM4/5/12
to Chromium-extensions
I need tho access the contents of an iframe via javascript.

I know this is usually blocked due to cross origin policies, but I
need this inside a Chrome extension, and usually in these cases the
manifest directives can unlock security policies.

I've found a lot of request about content scripts accessing iframes,
but in my case it is not a content script, it is just an iframe inside
a extension/app page.

Is there a way to do it?

PhistucK

unread,
May 7, 2012, 3:37:31 PM5/7/12
to UVL, Chromium-extensions
No, you will have to use message passing and a content script.

PhistucK




--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Devin

unread,
May 8, 2012, 2:18:54 PM5/8/12
to Chromium-extensions
You can inject a content script to all_frames and into the iframe, but
you can only access the inside of an iframe if it's the same origin.
you can also more directly use postMessage for frame messaging,
instead of background page messaging
Reply all
Reply to author
Forward
0 new messages