MediaWiki REL1_37
MediaWiki\Hook\ContentSecurityPolicyScriptSourceHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inheritance diagram for MediaWiki\Hook\ContentSecurityPolicyScriptSourceHook:

Public Member Functions

 onContentSecurityPolicyScriptSource (&$scriptSrc, $policyConfig, $mode)
 Use this hook to modify the allowed CSP script sources.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ContentSecurityPolicyScriptSource" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 12 of file ContentSecurityPolicyScriptSourceHook.php.

Member Function Documentation

◆ onContentSecurityPolicyScriptSource()

MediaWiki\Hook\ContentSecurityPolicyScriptSourceHook::onContentSecurityPolicyScriptSource ( $scriptSrc,
  $policyConfig,
  $mode 
)

Use this hook to modify the allowed CSP script sources.

Note that you also have to use ContentSecurityPolicyDefaultSource if you want non-script sources to be loaded from whatever you add.

Since
1.35
Parameters
string[]&$scriptSrcArray of CSP directives
array$policyConfigCurrent configuration for the CSP header
string$modeContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: