From 75253d34234304adc01c737dc3a3db7c79ed778e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 27 Mar 2024 01:15:33 +0100 Subject: [PATCH] Fix: Propagate nonce properly to loaded script Resolves #409 It seems we only need to tell webpack to do it with a oneliner: https://webpack.js.org/guides/csp/ We just do what NC's Markdown editor does: https://github.com/nextcloud/richdocuments/blob/ccdd7fcb52857225784cf686373253a2b6ea539a/src/admin.js#L10 --- src/personalSettings.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/personalSettings.js b/src/personalSettings.js index a32c049..3c228ef 100644 --- a/src/personalSettings.js +++ b/src/personalSettings.js @@ -2,6 +2,10 @@ import Vue from 'vue' import './bootstrap.js' import PersonalSettings from './views/PersonalSettings.vue' +// CSP config for webpack dynamic chunk loading +// eslint-disable-next-line +__webpack_nonce__ = btoa(OC.requestToken) + new Vue({ // eslint-disable-line no-new el: '#workflow_media_converter-personalSettings', render: h => h(PersonalSettings),