| ContentSecurityPolicyScriptSource | |
|---|---|
| Available fromversion 1.32.0 Modify the allowed CSP script sources. | |
| Define function: | publicstaticfunctiononContentSecurityPolicyScriptSource(array&scriptSrc,array$policyConfig,int$mode){...} |
| Attach hook: | Inextension.json:{"Hooks":{"ContentSecurityPolicyScriptSource":"MediaWiki\\Extension\\MyExtension\\Hooks::onContentSecurityPolicyScriptSource"}} |
| Called from: | File(s):ContentSecurityPolicy.php |
| Interface: | ContentSecurityPolicyScriptSourceHook.php |
For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:ContentSecurityPolicyScriptSource extensions.
Note that you also have to useContentSecurityPolicyDefaultSource if you want non-script sources to be loaded from whatever you add.
&$scriptSrc: Array ofContent-Security-Policy directives$policyConfig: Current configuration for theContent-Security-Policy header$mode:ContentSecurityPolicy::REPORT_ONLY_MODE orContentSecurityPolicy::FULL_MODE depending on type of header