You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@shindig.apache.org by Darren Bond <db...@globalcad.com> on 2014/03/20 15:38:21 UTC

Cross Domain iFrame Communication

Dear All,
We’re using Java Shindig to render gadgets on an HTML page. We would like to communicate with the gadgets' hosted iFrames in order to re-color their backgrounds or make their backgrounds transparent.
A cross-domain technique needs to be used since most of these iFrames reside on other domains. Examples exist to perform this cross-domain communication e.g. http://www.shouldersofgiants.co.uk/Examples/CrossDomain/ParentPage.html
However, to implement such a solution, I believe we need to modify specific Shindig file(s). Since Shindig URLs are formed dynamically, we're unable to find the necessary page to modify. I am looking to the Shindig API for functions which will allow us to inject some style rules or pass a URL to a custom CSS file to achieve the above.
Can anyone help? Thanks.
Kind regards,
Darren

 

Re: Cross Domain iFrame Communication

Posted by Ryan Baxter <rb...@apache.org>.
One way to do this would be to add a gadget rewriter which injects the
CSS into the gadget when it renders.  For example the default CSS that
Shindig injects is done in the RenderingGadgetRewriter [1].

[1] https://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderingGadgetRewriter.java

On Thu, Mar 20, 2014 at 10:38 AM, Darren Bond <db...@globalcad.com> wrote:
> Dear All,
> We're using Java Shindig to render gadgets on an HTML page. We would like to communicate with the gadgets' hosted iFrames in order to re-color their backgrounds or make their backgrounds transparent.
> A cross-domain technique needs to be used since most of these iFrames reside on other domains. Examples exist to perform this cross-domain communication e.g. http://www.shouldersofgiants.co.uk/Examples/CrossDomain/ParentPage.html
> However, to implement such a solution, I believe we need to modify specific Shindig file(s). Since Shindig URLs are formed dynamically, we're unable to find the necessary page to modify. I am looking to the Shindig API for functions which will allow us to inject some style rules or pass a URL to a custom CSS file to achieve the above.
> Can anyone help? Thanks.
> Kind regards,
> Darren
>
>