mirror of
https://github.com/9001/copyparty.git
synced 2026-09-24 13:50:16 +01:00
fix csp-nonce on chrome<62
This commit is contained in:
@@ -46,6 +46,9 @@ var wah = '',
|
||||
if (!window.WebAssembly || !WebAssembly.Memory)
|
||||
window.WebAssembly = false;
|
||||
|
||||
if (!window.AbortController)
|
||||
window.AbortController = false;
|
||||
|
||||
if (!window.Notification || !Notification.permission)
|
||||
window.Notification = false;
|
||||
|
||||
@@ -450,8 +453,11 @@ function import_js(url, cb, ecb) {
|
||||
var head = document.head || document.getElementsByTagName('head')[0];
|
||||
var script = mknod('script');
|
||||
script.type = 'text/javascript';
|
||||
if (window.JS_NONCE)
|
||||
if (window.JS_NONCE) {
|
||||
script.nonce = JS_NONCE;
|
||||
if (!AbortController)
|
||||
script.setAttribute('nonce', JS_NONCE);
|
||||
}
|
||||
script.src = url + '?_=' + (window.TS || 'a');
|
||||
script.onload = cb;
|
||||
script.onerror = ecb || function () {
|
||||
|
||||
Reference in New Issue
Block a user