Update index.js

trigger only  after document readstate change to complete
This commit is contained in:
Neil deGrasse Tyson 2024-11-02 14:01:20 +08:00 committed by GitHub
parent cb790fd466
commit 72bc3299e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -223,12 +223,14 @@
};
const init = () => {
if (!initialized) {
track();
handlePathChanges();
handleTitleChanges();
handleClicks();
initialized = true;
if(document.readyState==='complete'){
if (!initialized) {
track();
handlePathChanges();
handleTitleChanges();
handleClicks();
initialized = true;
}
}
};