public interface ContentSecurityPolicyHTMLRewriter
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
rewriteInlineEventHandlers(java.lang.String html,
javax.servlet.http.HttpServletRequest httpServletRequest,
boolean recursive)
Transform a fragment of HTML extracting all inline event handlers (e.g.:
onclick, onfocus, etc.) to a <script> node so that restrictive
content security policies like
script-src-attr 'none'; do
not prevent their execution. |
java.lang.String rewriteInlineEventHandlers(java.lang.String html,
javax.servlet.http.HttpServletRequest httpServletRequest,
boolean recursive)
script-src-attr 'none'; do
not prevent their execution.html - the HTML to transformhttpServletRequest - needed to obtain the content security policy nonce to use in the <script> noderecursive - whether to rewrite all nodes or only the top level ones