[ https://issues.apache.org/jira/browse/SHINDIG-1267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803163#action_12803163 ]
John Hjelmstad commented on SHINDIG-1267: ----------------------------------------- Implemented: http://codereview.appspot.com/186253/show > Implement affirmative signal of "gadget-ness" for use by gadgets.rpc > initialization > ----------------------------------------------------------------------------------- > > Key: SHINDIG-1267 > URL: https://issues.apache.org/jira/browse/SHINDIG-1267 > Project: Shindig > Issue Type: Improvement > Components: Javascript > Affects Versions: 1.1-BETA6 > Reporter: John Hjelmstad > Assignee: John Hjelmstad > > People are increasingly using gadgets.rpc as a cross-domain communication > library for arbitrary IFRAMEs. In doing so (and for type=url gadgets), they > typically do: > <script src="http://server.com/gadgets/js/rpc.js?c=1"/> > ...then initialize communication. > The above inclusion now (properly) pulls in gadgets.config libs, so the check > in rpc.js that determines "gadget-ness" for initialization purposes is > rendered meaningless: > if (gadgets.config) { > setupContainerGadgetContext(rpctoken); > } else { > // never happens > setupContainerGenericIframe(rpctoken, opt_receiverurl); > } > I propose adding a small JS beacon in the gadget-rendering case, in > RenderingGadgetRewriter, that affirms that the context is in fact that a > gadget is being processed. In particular, this ensures that > gadgets.config.init({"rpc":...}) will be called. > The beacon will be small eg: > <script>window["__isgadget"] = true;</script> > With this injected and gadgets.rpc updated to use the check, initialization > should work properly for all cases. At such time as we're comfortable getting > rid of IFPC, we can remove all of this and just use > setupContainerGenericIframe(...) always. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.