CSP Compatibility

This can be considered part of issue #828 still, however I have no way to attach the pull request to that issue.