Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_texteditor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-09-13 17:06:11 +0300
committerJulius Härtl <jus@bitgrid.net>2019-01-18 13:48:56 +0300
commitb89af7579e4af0e179e2d28204f97a1bd3997e03 (patch)
tree6f1f9f87a167f87b422c6da158ffd436449d5d22 /js
parentad569e7d6b5c8d161be6293d53fed7da4abb4387 (diff)
More reliable way to get the nonce
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'js')
-rw-r--r--js/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/index.js b/js/index.js
index 93343b5..5e75c35 100644
--- a/js/index.js
+++ b/js/index.js
@@ -15,7 +15,8 @@ import {newFileMenuPlugin} from './newfileplugin';
// convince webpack to load chunks
__webpack_require__.p = OC.filePath('files_texteditor', 'js', '../build/');
-__webpack_require__.nc = $('script[nonce][src]')[0].getAttribute('nonce');
+const script = document.querySelector('[nonce]');
+__webpack_require__.nc = script['nonce'] || script.getAttribute('nonce');
window.ace = ace;