24
1
Fork 0
drop.chapril.org-firefoxsend/server/initScript.js

19 lines
454 B
JavaScript
Raw Normal View History

2018-08-08 00:40:17 +02:00
const html = require('choo/html');
const raw = require('choo/html/raw');
module.exports = function(state) {
// return '';
return state.cspNonce
? html`
2018-11-16 21:39:36 +01:00
<script nonce="${state.cspNonce}">
const LOCALE = '${state.locale}';
2018-11-16 21:39:36 +01:00
const downloadMetadata = ${
state.downloadMetadata
? raw(JSON.stringify(state.downloadMetadata))
: '{}'
};
</script>
`
2018-08-08 00:40:17 +02:00
: '';
};