refreshless-8.x-1.x-dev/modules/refreshless_turbo/tests/modules/refreshless_turbo_script_manager_test/js/remover.js
modules/refreshless_turbo/tests/modules/refreshless_turbo_script_manager_test/js/remover.js
(function(html, $, once) { $(once(
'refreshless-turbo-reload-reason', html,
)).each(() => {
'use strict';
/**
* The name of the attribute to find <script> elements to remove by.
*
* @type {String}
*/
const removeAttribute = 'data-refreshless-turbo-script-manager-test-remove';
$(html).on('refreshless:before-scripts-merge', (event) => {
// This should prevent merging of any <script> elements designated with our
// attribute.
event.detail.new = $(event.detail.new).not(
`[${removeAttribute}]`,
).toArray();
});
}); })(document.documentElement, jQuery, once);
