From ab791921ea92371408ac803a4762c8638c046043 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 4 Sep 2026 17:54:20 +0000 Subject: [PATCH] fix csp-nonce on chrome<62 --- copyparty/web/util.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 27bf24cee..f50710e7f 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -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 () {