aboutsummaryrefslogtreecommitdiff
path: root/assets/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/index.js')
-rw-r--r--assets/js/index.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index 69001ad..55a9bf2 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -739,8 +739,7 @@
});
});
[
- "storage",
- "DOMContentLoaded"
+ "storage"
].forEach(function(event) {
self.addEventListener(event, function() {
let stylesheet;
@@ -775,6 +774,17 @@
}
});
});
+ const early = setInterval(persistence, 4);
+ function persistence() {
+ if (document.styleSheets.length > 0) {
+ self.dispatchEvent(new Event("storage"));
+ clearInterval(early);
+ }
+ }
+ self.addEventListener("DOMContentLoaded", function() {
+ self.dispatchEvent(new Event("storage"));
+ clearInterval(early);
+ });
})();
(function() {
const timeout = 300;