It does exactly what it says it does. It captures an execCommand
call, checks if the first parameter is innerHTMLinsertHTML
, and if so, sanitizes the input using the LWS HTML sanitation function. After that, the real function is called using the first parameter, and the real or sanitized second parameter, if any. This is the same function that's called to make sure templates and other code can't execute direct scripts that may be outside of the LWS sandbox.