diff options
author | Robin Appelman <robin@icewind.nl> | 2017-09-13 17:06:11 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-01-18 13:48:56 +0300 |
commit | b89af7579e4af0e179e2d28204f97a1bd3997e03 (patch) | |
tree | 6f1f9f87a167f87b422c6da158ffd436449d5d22 /js | |
parent | ad569e7d6b5c8d161be6293d53fed7da4abb4387 (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.js | 3 |
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; |