Allow runMain to work with CSP enforced (#1021)

The injected client runs the main method by adding a script tag. If CSP is enforced this will fail as the script tag does not have a nonce as defined by the [spec](https://w3c.github.io/webappsec-csp/#grammardef-base64-value). Update the logic to include a nonce if one is available.
5 files changed