Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:Hooks/ContentSecurityPolicyScriptSource

From mediawiki.org
<Manual:Hooks
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.

Details

[edit]
  • &$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
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:Hooks/ContentSecurityPolicyScriptSource&oldid=3304168"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp