fix: prevent duplicate styles during pjax updates

This commit is contained in:
Erzbir
2026-08-17 01:36:51 +08:00
parent b6e84de616
commit 5998ac1cbb
-12
View File
@@ -76,18 +76,6 @@ function insertStyle(dom, parentElement, selectors) {
parentElement.appendChild(style); parentElement.appendChild(style);
} }
}); });
const existingStyles = new Set();
document.querySelectorAll(selectors).forEach(style => {
let hash = djb2(style.innerHTML);
existingStyles.add(style);
});
dom.querySelectorAll(selectors).forEach(style => {
if (style && !existingStyles.has(style)) {
parentElement.appendChild(style);
}
});
} }
function insertScript(dom, parentElement, selectors) { function insertScript(dom, parentElement, selectors) {