|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.parse.caja.CajaCssSanitizer
public class CajaCssSanitizer
Sanitize a CSS tree using Caja. Strip properties and functions that represent ways to execute script. Specifically - Use Caja's CSS property whitelist - Use Caja's CSS function whitelist - Force @import through the proxy and require sanitization. If they cant be parsed, remove them - Force @url references to have the HTTP/HTTPS protocol
| Constructor Summary | |
|---|---|
CajaCssSanitizer(CajaCssParser parser)
|
|
| Method Summary | |
|---|---|
void |
sanitize(com.google.caja.parser.css.CssTree css,
Uri linkContext,
GadgetContext gadgetContext,
ProxyUriManager importRewriter,
ProxyUriManager imageRewriter)
Sanitize the given CSS tree in-place by removing all non-whitelisted function calls |
void |
sanitize(Element styleElem,
Uri linkContext,
GadgetContext gadgetContext,
ProxyUriManager importRewriter,
ProxyUriManager imageRewriter)
Sanitize the CSS content of a style tag. |
String |
sanitize(String content,
Uri linkContext,
GadgetContext gadgetContext,
ProxyUriManager importRewriter,
ProxyUriManager imageRewriter)
Sanitize the CSS content of a style tag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public CajaCssSanitizer(CajaCssParser parser)
| Method Detail |
|---|
public String sanitize(String content,
Uri linkContext,
GadgetContext gadgetContext,
ProxyUriManager importRewriter,
ProxyUriManager imageRewriter)
content - to sanitizelinkContext - url of containing contentgadgetContext - The gadget context.importRewriter - to rewrite @imports to sanitizing proxyimageRewriter - to rewrite images to sanitizing proxy
public void sanitize(Element styleElem,
Uri linkContext,
GadgetContext gadgetContext,
ProxyUriManager importRewriter,
ProxyUriManager imageRewriter)
styleElem - to sanitizelinkContext - url of containing contentgadgetContext - The gadget context.importRewriter - to rewrite @imports to sanitizing proxyimageRewriter - to rewrite images to sanitizing proxy
public void sanitize(com.google.caja.parser.css.CssTree css,
Uri linkContext,
GadgetContext gadgetContext,
ProxyUriManager importRewriter,
ProxyUriManager imageRewriter)
css - DOM rootlinkContext - url of containing contentgadgetContext - The gadget context.importRewriter - to rewrite links to sanitizing proxyimageRewriter - to rewrite links to the sanitizing proxy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||