mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 15:13:21 +08:00
11 lines
371 B
JavaScript
11 lines
371 B
JavaScript
|
document.addEventListener('turbolinks:request-start', function(event) {
|
||
|
var xhr = event.data.xhr;
|
||
|
xhr.setRequestHeader('X-Turbolinks-Nonce', $('meta[name="csp-nonce"]').prop('content'));
|
||
|
});
|
||
|
|
||
|
document.addEventListener('turbolinks:before-cache', function() {
|
||
|
$('script[nonce]').each(function(_index, element) {
|
||
|
$(element).attr('nonce', element.nonce);
|
||
|
});
|
||
|
});
|