简体   繁体   English

谷歌caja如何使用

[英]google caja how to use

let say i have a page , and i want to allow 3rd party to embed small application/iframe into my page. 假设我有一个页面,我想允许第三方将小应用程序/ iframe嵌入到我的页面中。 in order to use caja on my page to secure the 3rd party small app/iframe. 为了在我的页面上使用caja来保护第三方小应用程序/ iframe。 do i need to put any extra javascript/serverside code in order to use caja? 我需要添加任何额外的javascript /服务器端代码才能使用caja吗? fetching of the 3rd party small application is done through proxy or direct iframe? 通过代理或直接iframe获取第三方小应用程序?

There are two main ways to use the Caja rewriter; 使用Caja重写器有两种主要方式; if your server is coded in Java, then you can build Caja into your server and invoke the classes directly. 如果您的服务器是用Java编码的,那么您可以将Caja构建到您的服务器中并直接调用这些类。 Otherwise, you run Caja as its own server (the Cajoling Service) and it will rewrite the third-party code. 否则,您将Caja作为自己的服务器(Cajoling服务)运行,它将重写第三方代码。 That code needs to be served on a page with the Caja runtime library and some setup code that grants the cajoled code some portion of the DOM to render in. Like the first poster said, the CajaHostingModules page is an example of one way to do this. 该代码需要在具有Caja运行时库和一些设置代码的页面上提供,该代码授予呈现的DOM的某些部分的cajoled代码。就像第一张海报所说,CajaHostingModules页面是一种实现此目的的方法的示例。

Please follow up with any further questions on the mailing list: google-caja-discuss@googlegroups.com . 请跟进邮件列表中的任何其他问题: google-caja-discuss@googlegroups.com Thanks! 谢谢!

It sounds like you want to host a Caja module in your page? 听起来你想在你的页面中托管一个Caja模块? Check out the integration guide documentation . 查看集成指南文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM