Support comments in JS Whitelist.
This commit is contained in:
parent
901652e17e
commit
f92e12acaa
@ -143,6 +143,9 @@
|
||||
|
||||
<fieldset>
|
||||
<legend>Javascript Whitelist</legend>
|
||||
<div>Sources from which Javascript is allowed to be loaded by <a href="http://content-security-policy.com/#source_list" target="_blank">Content Security Policy</a>.</div>
|
||||
<div>
|
||||
Sources from which Javascript is allowed to be loaded by <a href="http://content-security-policy.com/#source_list" target="_blank">Content Security Policy</a>.<br>
|
||||
Lines starting with a <code>#</code> will be ignored.
|
||||
</div>
|
||||
<textarea name="jsWhitelist" class="field" spellcheck="false"></textarea>
|
||||
</fieldset>
|
||||
|
||||
@ -60,7 +60,7 @@ Main =
|
||||
|
||||
# Enforce JS whitelist
|
||||
($.getSync or $.get) {'jsWhitelist': Conf['jsWhitelist']}, ({jsWhitelist}) ->
|
||||
$.addCSP "script-src #{jsWhitelist.replace(/[\s;]+/g, ' ')}"
|
||||
$.addCSP "script-src #{jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()}"
|
||||
|
||||
# Get saved values as items
|
||||
items = {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user