We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ba5da9 commit 0ef40bdCopy full SHA for 0ef40bd
src/index.ts
@@ -83,7 +83,15 @@ function checkClientHints() {
83
cookieChanged = true;
84
}
85
86
- if (cookieChanged) window.location.reload();
+ if (cookieChanged) {
87
+ // Hide the page content immediately to prevent visual flicker
88
+ const style = document.createElement('style');
89
+ style.textContent = 'html { visibility: hidden !important; }';
90
+ document.head.appendChild(style);
91
+
92
+ // Trigger the reload
93
+ window.location.reload();
94
+ }
95
96
97
checkClientHints();
0 commit comments