HH-531: remove CSP-blocked draggable shim (#122)

Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
Rogee
2026-08-23 17:48:30 +08:00
committed by GitHub
co-authored by rogee
parent f719a18ba8
commit a635be6dc8
2 changed files with 14 additions and 0 deletions
+10
View File
@@ -27,3 +27,13 @@ assert.ok(
);
assert.ok(!/<script(?![^>]*\bsrc=)[^>]*>/i.test(html), 'inline script found');
assets.forEach(asset => assert.ok(existsSync(dist + asset.slice(1)), asset));
const dashboard = assets
.filter(asset => asset.endsWith('.js'))
.map(asset => readFileSync(dist + asset.slice(1), 'utf8'))
.join('\n');
assert.doesNotMatch(
dashboard,
/=\(?function\(\)\{return this\}\)?\(\);try\{([A-Za-z_$][\w$]*)=\1\|\|new Function\("return this"\)\(\)/,
'dashboard contains a CSP-blocked UMD global shim'
);
+4
View File
@@ -44,6 +44,10 @@ const resolveAliases = {
survey: path.resolve(__dirname, './app/javascript/survey'),
widget: path.resolve(__dirname, './app/javascript/widget'),
assets: path.resolve(__dirname, './app/javascript/dashboard/assets'),
vuedraggable: path.resolve(
__dirname,
'./node_modules/vuedraggable/src/vuedraggable.js'
),
'@material/mwc-icon': path.resolve(
__dirname,
'./app/javascript/shared/components/MaterialIconElement.js'