< Manual:Hooks
| ContentSecurityPolicyDirectives | |
|---|---|
| Available from version 1.32.0 Modify the content security policy directives. | |
| Define function: | public static function onContentSecurityPolicyDirectives( array &$directives, array $policyConfig, int $mode ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"ContentSecurityPolicyDirectives": "MyExtensionHooks::onContentSecurityPolicyDirectives"
}
}
|
| Called from: | File(s): ContentSecurityPolicy.php |
| Interface: | ContentSecurityPolicyDirectivesHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ContentSecurityPolicyDirectives extensions.
Use this only if ContentSecurityPolicyDefaultSource and ContentSecurityPolicyScriptSource do not meet your needs.
Details
&$directives: Array ofContent-Security-Policydirectives$policyConfig: Current configuration for theContent-Security-Policyheader$mode:ContentSecurityPolicy::REPORT_ONLY_MODEorContentSecurityPolicy::FULL_MODEdepending on type of header
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.